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, 4 months 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, 4 months 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, 4 months 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, 4 months 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 2 years, 1 month 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 2 years, 1 month 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.50 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint