Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to stop (dyna)form submission on enter key in html:text field.

Status
Not open for further replies.

bluepixie

Programmer
Jul 31, 2003
34
US
Hi,
I am using java and struts framework on a handheld but I might need pure html help. I can't use javascript to stop enter in the text field to submit the dynaform in the jsp. The field is a <html:text /> field.
Help!
Thanks!
 
try a textarea:
Code:
<textarea name=&quot;myTextArea&quot;>Starting Text Here</textarea>


Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
try this:

<script type=&quot;text/javascript&quot;>
function noEnter(e) {
try {
return event.keyCode != 13;
} catch(E) {
return e.which != 13;
}
}
</script>


<input type=&quot;text&quot; onkeypress=&quot;return noEnter(event);&quot; />



=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top