Welcome, Guest

How to convert a field to Capitals / Uppercase
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: How to convert a field to Capitals / Uppercase

How to convert a field to Capitals / Uppercase 2 years, 1 month ago #10822

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
  • plymouthpc
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0

Re: How to convert a field to Capitals / Uppercase 2 years, 1 month ago #10852

Hi,

by using javascript or by php?
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re: How to convert a field to Capitals / Uppercase 2 years, 1 month ago #10878

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
  • plymouthpc
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0

Re: How to convert a field to Capitals / Uppercase 2 years, 1 month ago #10910

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(); 
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re: How to convert a field to Capitals / Uppercase 1 year, 10 months ago #13048

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.
  • Ian McLean
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
  • Karma: 0

Re: How to convert a field to Capitals / Uppercase 1 year, 10 months ago #13166

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

  • geomh
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
  • Page:
  • 1
  • 2
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.45 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany