Submitting form with enter key

Results 1 to 2 of 2

Thread: Submitting form with enter key

  1. #1
    Join Date
    Dec 1969

    Default Submitting form with enter key

    I have an html search page with a submit button. I want the search to run also if I press the enter key.<BR><BR>I added the following code to my page...<BR><BR>&#060;body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" onLoad="javascript:;"&#062;<BR><BR>and also...<BR><BR>&#060;input TYPE="submit" value="Cerca" onclick="call_right_page();"&#062;<BR><BR>and with this code when I try pressing the enter key I see this in the address bar:<BR><BR>http://decs2345/eventidb/Data=&Anno=2001&Citta=&Tipologia=Seminario%2FWorks hop&Mercato=&Contenuti=<BR><BR>BUT when the enter key is pressed the form on my search page is reset and nothing happens, I only see the above in the address bar and I see the form reset without any information in the boxes. Nothing else happens, I don&#039;t see any search results. With this code when I click on the submit button the same thing happens, the search doesn&#039;t work even if I click on the submit button.<BR><BR>Originally my input type=button instead of submit and I didn&#039;t have the javascript in the body tag. With the original code the search worked only when I clicked on the button.<BR><BR>So I simply just want to get my search page working when I click on the button but ALSO if I press the enter key...hope someone can help...<BR><BR>Anna

  2. #2
    Join Date
    Dec 1969

    Default RE: Submitting form with enter key

    It seems that your form is being submitted to itself. I would check the form tags. If you want to submit it do different locations, you need to use a variable for the action value.<BR>HTH.<BR>Lana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts