TOPIC:

How to convert a field to Capitals / Uppercase 10 years 6 months ago #10822

  • Topic Author
  • plymouthpc
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
I have a field that allows the user to enter a code, we then check that code against a number of variables, before I do that I want to convert the inputted variable to uppercase so for example.

ab123 would become AB123 or aB12c would become AB12C

tried using variable = strtoupper(variable) but can not get this to work

Please Log in or Create an account to join the conversation.

Re: How to convert a field to Capitals / Uppercase 10 years 6 months ago #10852

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9255
  • Karma: 167
  • Thanks: 744
Hi,

by using javascript or by php?

Please Log in or Create an account to join the conversation.

Re: How to convert a field to Capitals / Uppercase 10 years 6 months ago #10878

  • Topic Author
  • plymouthpc
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
php i guess, dont know myself no longer code until I started trying to sort this out, just want something that works.

we have a line that gets the value of a field entered by user then we check that field with switch/case and send the user to an appropriate form depending on what code is entered.

but this fails if they entered data in lowercase or a mixture of the two

Please Log in or Create an account to join the conversation.

Re: How to convert a field to Capitals / Uppercase 10 years 6 months ago #10910

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9255
  • Karma: 167
  • Thanks: 744
I would create a custom validation, since that will be js and do it like this:
ff_getElementByName("thecode").value = ff_getElementByName("thecode").value.toUpperCase(); 

Please Log in or Create an account to join the conversation.

Re: How to convert a field to Capitals / Uppercase 10 years 3 months ago #13048

  • Ian McLean
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
Hi,

I'm trying to do the same thing. In your example above, What do I enter where you have put "thecode"? Sorry, but I have no programming knowledge.

Please Log in or Create an account to join the conversation.

Re: How to convert a field to Capitals / Uppercase 10 years 3 months ago #13166

  • geomh
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Karma: 1
  • Thanks: 1
Hi, Use this

function ff_nameoftheelement_action(element, action)
{ff_getElementByName('nameoftheelement').value = ff_getElementByName('nameoftheelement').value.toUpperCase();
} //ff_nombre_action

In the above code replace nameoftheelement to the real name of each element in your form you need to convert to uppercase

In the advanced tab of each element select Actioscript Custom, in action select change and paste the code
The following user(s) said Thank You: cledob

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.054 seconds

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!