Solved

Form Order

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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 …

832 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