V
Veerle
Hi,
When you use multiple asp:Buttons on one Form, then asp.net generates
html submit buttons for all of them. When you put your cursor in one
of the textfields of the form, the default submit button is the first
submit button of the form. So if you press enter, then the form is
submitted as if you pressed the first submit button of the form. But
sometimes, you want the default button to be the second or third
submit button of your form. No problem, you can set this by using the
DefaultButton property of the Form. Asp.net then generates an
attribute for the html form so that a javascript method makes sure
that the other submit button is used as default button (for when
someone presses enter). This generated attribute looks something like
this: onkeypress="javascript:return WebForm_FireDefaultButton(event,
'...')"
So far so good, only, Internet Explorer does not know we are altering
the default submit button to another submit button than the first one,
because this is done through javascript. So visually, it still draws
some kind of border round the first submit button, thinking this is
the default submit button. My question now is, how can I change this
behaviour so that Internet Explorer draws this extra border around the
real default button (set by javascript)?
Css doesn't seem to be much of a help, as IE6 doesn't support
"outline", ":focus", ":active" or any other stuff that you could use
to try and make things differently. So I guess that if there is a
solution, it should be something in javascript?
Any ideas?
Veerle
When you use multiple asp:Buttons on one Form, then asp.net generates
html submit buttons for all of them. When you put your cursor in one
of the textfields of the form, the default submit button is the first
submit button of the form. So if you press enter, then the form is
submitted as if you pressed the first submit button of the form. But
sometimes, you want the default button to be the second or third
submit button of your form. No problem, you can set this by using the
DefaultButton property of the Form. Asp.net then generates an
attribute for the html form so that a javascript method makes sure
that the other submit button is used as default button (for when
someone presses enter). This generated attribute looks something like
this: onkeypress="javascript:return WebForm_FireDefaultButton(event,
'...')"
So far so good, only, Internet Explorer does not know we are altering
the default submit button to another submit button than the first one,
because this is done through javascript. So visually, it still draws
some kind of border round the first submit button, thinking this is
the default submit button. My question now is, how can I change this
behaviour so that Internet Explorer draws this extra border around the
real default button (set by javascript)?
Css doesn't seem to be much of a help, as IE6 doesn't support
"outline", ":focus", ":active" or any other stuff that you could use
to try and make things differently. So I guess that if there is a
solution, it should be something in javascript?
Any ideas?
Veerle