Link to home
Start Free TrialLog in
Avatar of Bill Henderson
Bill HendersonFlag for United States of America

asked on

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

Hi,

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...

Thanks

Bill
Avatar of Bill Henderson
Bill Henderson
Flag of United States of America image

ASKER

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?
Avatar of Gary
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.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@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.
Thanks Gary - trying today...
Thanks for the help!