Solved

Form Order

Posted on 2003-10-22
3
156 Views
Last Modified: 2010-04-09
I have created a page with a form that is submitted via a button click that runs a javascript function which calls the form.submit() method.

When I fill in information into a textbox on the form, I would like the form to submit when I press ENTER (like yahoo). However, the page merely refreshes itself. I tried setting the tab order of the button (which is type="button") to 1 but that does not seem to help either. Any suggestions?
0
Comment
Question by:edesmarais
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:proziath
ID: 9602492
Is it possible you could show us the code?

My thinking is that a normal submit for would have a button of type SUBMIT and on clicking this button it should submit with no problems. If you want to run a javascript function for whatever purpose then it iwould be activated using the onsubmit event.
0
 
LVL 2

Expert Comment

by:proziath
ID: 9602493
Is it possible you could show us the code?

My thinking is that a normal submit for would have a button of type SUBMIT and on clicking this button it should submit with no problems. If you want to run a javascript function for whatever purpose then it iwould be activated using the onsubmit event.
0
 
LVL 58

Accepted Solution

by:
Gary earned 50 total points
ID: 9603797
Have you set an Action in the Form tag?

<script language=javascript>
function FormSubmit(){
document.myform.submit()
}
</script>
<form name="myform" action="nextpage.asp" method="POST">
<input type=button name=Submit onclick=FormSubmit()>
</form>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question