lowercase - Javascript to make a text field have capital first letter and rest lower case -


i using form software has limited editing capabilities, allows add java script. use php this, in case have use javascript, have little experience with.

essentially on landing page, have form in people can submit. first name last name email etc.

the problem - mail merge submissions, , when people enter name bob smith or bob smith , not bob smith, makes unprofessional when send them email. add javascript landing page when form submits, converts strings in first_name text field , last_name text field have first letter capitalized, , rest lower case. problem not think can edit form properties, if @ possible javascript go @ top of page, , dont have edit text field properties activate it...any appreciated.

thanks

here javascript gist building human-readable names created need plus little extra.

i wont try explain , instead, here examples:

//dan macdonald -> dan macdonald [call true] //dan mcdonald  -> dan mcdonald [call true] //paz y miño    -> paz y miño [call true] //ben d'hosier  -> ben d'hosier //sara ma'afala -> sara ma'afala 

include in page so:

<script src="https://gist.github.com/isaacdozier/5ae92c1da9622c77df4c9a70a9f9a849.js"> </script> 

or access raw file @ https://gist.githubusercontent.com/isaacdozier/5ae92c1da9622c77df4c9a70a9f9a849/raw/a81c877e77a3c0c3a795ac40bbf6721950cb2e05/read-names.js

call fuction this:

capsfullname('john smith') 

which outputs 'john smith'

or this

capsfullname('sara y gonzalez', true) 

which outputs 'sara y gonzalez'

note: capsfullname('sara y gonzalez') outputs 'sara y gonzalez'


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -