This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Disable form submit on carriage return in a text box for MAC systems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disable form submit on carriage return in a text box for MAC systems" Watch "Disable form submit on carriage return in a text box for MAC systems" New topic
Author

Disable form submit on carriage return in a text box for MAC systems

sripal jain
Greenhorn

Joined: Sep 10, 2002
Posts: 10
Hi All,
I have a problem that is specific to MAC systems . The problem is when i press enter button(carriage return ), when the focus is on text box the form gets submitted. Is there any way in which i can handle it not to submit and gets submitted only when the Submit button is clicked.
This is very urgent and important and if any body knows the solution do not delay and send that to me.
Thanks in Advance...
Sripal
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

yes, you can use type="button" instead of type="submit"

<input type="button" on_click="document.myform.submit">

i believe that is the proper syntax where "myform" is the name of your form (remove the underscore).


SCJP
Visit my download page
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable form submit on carriage return in a text box for MAC systems
 
Similar Threads
basic doubt
Unable to submit form in single click
Problem in Reset button.
type "button" vs "submit"
handle radio buttons in servlet