Solved

Form Order

Posted on 2003-10-22
3
137 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 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now