Setting default button

  • Thread starter Thread starter Xarky
  • Start date Start date
X

Xarky

Hi,
I have a page with 2 textboxes(Name and Surname) and two
buttons(Submit and Reset).

Now I have set the tab for them
1 Name
2 Surname
3 Submit
4 Reset

Now I am entering the name, entering the surname and while I am on the
surname I press Enter and the Reset button is being pressed.

How can I change it so that by default the Submit button is pressed
instead.

Can someone help me out please.
Thanks in Advance
 
It isn't the label that defines a button. It's the type. Example:

<input type="submit" value="Reset">

Makes a Submit button with the label "Reset".

<input type="reset" value="Submit">

Makes a Reset button with the label "Submit".

<input type="button" value="Click Me">

Makes a normal button that has a label "Click Me" and does nothing when
clicked, as it has no "onclick" event handler.

Now, a browser will, by default submit a form when you press the ENTER key.
So, it all depends on what type of buttons you're using, which one gets the
event handler.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
Back
Top