iPad form submittals are breaking my CRM code - need to stop carriage returns


We have a text area field in a form that some people fill out with their iPads. Unfortunately, if these users hit the Return key on their iPad keyboard when in this textarea field, it's saving a value (can't tell what it is - MSSQL just shows a linebreak in the db table) but this is breaking a javascript calendar grid we are using.

Bottom line, we would like to have the enter key, if press, just close the keyboard view and not insert any value into the text area for that keystroke.

Is this possible? Maybe with some kind of blur command that detects that particular keystroke?

Just not sure how to achieve this...


Bill HendersonWeb MarketingAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill HendersonWeb MarketingAuthor Commented:
Thanks Quizwedge - hmm - I think this may be the opposite of what I'm after though - I'd be fine if the return key submitted the form instead of adding this line break in the textarea field.

Do you know how to do that?
To disable the enter key you can just add this to the textarea

onkeypress="if(event.keyCode==13){return false;}"

To close the keyboard you would need to set focus somewhere else.
To submit the form

onkeypress='if(event.keyCode==13){document.forms["form_name"].submit();return false;}'

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

@GaryC123 Thanks for the heads up. I hadn't seen that before and was trying to post something quickly from my phone. I'll add more explanation or link to a different site in the future.

@billium99 looks like @garyc123 answered but if you need more clarification let us know.
Not sure how this will work in the iphone but to lose focus on the textarea, which should hide the keyboard

onkeypress="if(event.keyCode==13){this.blur();return false;}"

All depends which solution you prefer.
Bill HendersonWeb MarketingAuthor Commented:
Thanks Gary - trying today...
Bill HendersonWeb MarketingAuthor Commented:
Thanks for the help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.