?
Solved

Form Order

Posted on 2003-10-22
3
Medium Priority
?
168 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
  • 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 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

850 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