simple question

Results 1 to 4 of 4

Thread: simple question

  1. #1
    Join Date
    Dec 1969

    Default simple question

    On my form is a txt field that the user enters a number and below that is a submit button. On some forms, if after the user fills in the txt field and hits ok, the page associates the 'Enter' button with the submit button. On other forms it does not. How can I make it uniform so that after a user enters data in the field they click the enter and it does the submit button?

  2. #2
    Join Date
    Dec 1969

    Default RE: simple question

    you could add a OnClick event to the button and have javascript post the form instead of using a submit button.<BR><BR>Read the faq&#039;s category Forms. There is something there for using JS to alter the forms actions...

  3. #3
    Join Date
    Dec 1969

    Default It's worse than that...

    Different browsers will react differently to the identical &#060;FORM&#062; contents.<BR><BR>Russell&#039;s suggestion is a good one: Don&#039;t use an &#060;INPUT TYPE=SUBMIT&#062; button. Instead, use<BR> &#060;INPUT Type=BUTTON Value="Go for it" onClick="this.form.submit( );"&#062;<BR>or, if you want to do validation,<BR> &#060;INPUT Type=BUTTON Value="Go for it" <BR> onClick="if ( validate(this.form) ) this.form.submit( );"&#062;<BR>

  4. #4

    Default RE: It's worse than that...

    I use this one that Bill suggested and its works very well. Havent had any problems with it.<BR><BR>&#060;INPUT Type=BUTTON Value="Go for it" onClick="this.form.submit( );"&#062; <BR>

Posting Permissions

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