multiple buttons on a form
This seems like a silly question, but I am wondering if anyone knows how to
default which button will be clicked when a user hits return on a form with
multiple buttons. The first button on the form is the one whose event is
automatically fired. I don't want that to happen.
In the .net framework library, I found information about creating the asp:buttons
as either a command or a submit button. I then created the first button
as a command, and the second as a submit, hoping to fire the second button
when the user of my form presses return. No such luck. I also tried setting
the "CausesValidation" of the first button to false, but still the first
button is the one clicked by default when the user presses return.
Any ideas?
Re: multiple buttons on a form
It's kinda browser specific, however there are ways to handle for different
browser types; see the link below:
http://ppewww.ph.gla.ac.uk/%7eflavel...mquestion.html
"val" <vwinberg@hotmail.com> wrote:
>
>This seems like a silly question, but I am wondering if anyone knows how
to
>default which button will be clicked when a user hits return on a form with
>multiple buttons. The first button on the form is the one whose event is
>automatically fired. I don't want that to happen.
>
>In the .net framework library, I found information about creating the asp:buttons
>as either a command or a submit button. I then created the first button
>as a command, and the second as a submit, hoping to fire the second button
>when the user of my form presses return. No such luck. I also tried setting
>the "CausesValidation" of the first button to false, but still the first
>button is the one clicked by default when the user presses return.
>
>Any ideas?
Re: multiple buttons on a form
Do anyone have the answer for the following question.
"Lonzo" <lonny.angell@omniresources.com> wrote:
>
>It's kinda browser specific, however there are ways to handle for different
>browser types; see the link below:
>
> http://ppewww.ph.gla.ac.uk/%7eflavel...mquestion.html
>
>
>
>"val" <vwinberg@hotmail.com> wrote:
>>
>>This seems like a silly question, but I am wondering if anyone knows how
>to
>>default which button will be clicked when a user hits return on a form
with
>>multiple buttons. The first button on the form is the one whose event
is
>>automatically fired. I don't want that to happen.
>>
>>In the .net framework library, I found information about creating the asp:buttons
>>as either a command or a submit button. I then created the first button
>>as a command, and the second as a submit, hoping to fire the second button
>>when the user of my form presses return. No such luck. I also tried setting
>>the "CausesValidation" of the first button to false, but still the first
>>button is the one clicked by default when the user presses return.
>>
>>Any ideas?
>
Re: multiple buttons on a form
Hello,
Haven't tried this myself to see if it works, but try setting the TabIndex
value of the button you want to be the default to 0 and any other buttons
to 1 or higher. Its what I would try, but again not definitely sure it will
work.
"arkatala" <arkatala@hotmail.com> wrote:
>
>Do anyone have the answer for the following question.
>
>
>"Lonzo" <lonny.angell@omniresources.com> wrote:
>>
>>It's kinda browser specific, however there are ways to handle for different
>>browser types; see the link below:
>>
>> http://ppewww.ph.gla.ac.uk/%7eflavel...mquestion.html
>>
>>
>>
>>"val" <vwinberg@hotmail.com> wrote:
>>>
>>>This seems like a silly question, but I am wondering if anyone knows how
>>to
>>>default which button will be clicked when a user hits return on a form
>with
>>>multiple buttons. The first button on the form is the one whose event
>is
>>>automatically fired. I don't want that to happen.
>>>
>>>In the .net framework library, I found information about creating the
asp:buttons
>>>as either a command or a submit button. I then created the first button
>>>as a command, and the second as a submit, hoping to fire the second button
>>>when the user of my form presses return. No such luck. I also tried
setting
>>>the "CausesValidation" of the first button to false, but still the first
>>>button is the one clicked by default when the user presses return.
>>>
>>>Any ideas?
>>
>
Re: multiple buttons on a form
Hi,
This is basic stuff. Try using type=button for all buttons except the one
you want to submit automatically. Then use the onclick event and javascript
to handle those buttons.
=================
"arkatala" <arkatala@hotmail.com> wrote:
>
>Do anyone have the answer for the following question.
>
>
>"Lonzo" <lonny.angell@omniresources.com> wrote:
>>
>>It's kinda browser specific, however there are ways to handle for different
>>browser types; see the link below:
>>
>> http://ppewww.ph.gla.ac.uk/%7eflavel...mquestion.html
>>
>>
>>
>>"val" <vwinberg@hotmail.com> wrote:
>>>
>>>This seems like a silly question, but I am wondering if anyone knows how
>>to
>>>default which button will be clicked when a user hits return on a form
>with
>>>multiple buttons. The first button on the form is the one whose event
>is
>>>automatically fired. I don't want that to happen.
>>>
>>>In the .net framework library, I found information about creating the
asp:buttons
>>>as either a command or a submit button. I then created the first button
>>>as a command, and the second as a submit, hoping to fire the second button
>>>when the user of my form presses return. No such luck. I also tried
setting
>>>the "CausesValidation" of the first button to false, but still the first
>>>button is the one clicked by default when the user presses return.
>>>
>>>Any ideas?
>>
>