Enter and Submit Button

Results 1 to 2 of 2

Thread: Enter and Submit Button

  1. #1
    Join Date
    Dec 1969

    Default Enter and Submit Button

    Hi, i am having trouble with setting focus to a submit button. On my website, i have a feature where one can search different items. I have a drop down box, text field and a submit button in a table row (all in that order). I would like the user to be able to just hit enter when a search criteria has been entered into the html text field without having to tab over. I thought this was fairly simple, but if i use events &#039;onclick&#039; and &#039;onfocus&#039; on the text field to set focus to the submit button then the cursor will always move to the submit button without letting the user enter anything. It&#039;s weird, cause i have a login page with username and password fields and submit button and i can just hit enter to login without tabing over. I have tried moving the submit button to another row but still did not work, please help.<BR><BR>Thanx

  2. #2
    Join Date
    Dec 1969

    Default RE: Enter and Submit Button

    Use script to check what character is being entered into the text box usually the on keypress event will do. If the enter key is pressed then submit the form. What script you use depends on your audience but for general web wrk use Javascript.

Posting Permissions

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