P
Paul
Hi
I need to set up the onfocus event for a checkbox and
radiobutton server control from the codebehind page. I am
trying something like:
this.MyCheckbox.Attributes.Add("onfocus", "alert
('gotit');");
or
this.MyCheckbox.Attributes["onfocus"] = "alert
('gotit');");
but neither work.
As you can see in the generated code the onfocus seems to
apply to a span tag, not directly to the controls
themselves:
<span onFocus="alert('gotit');"><label
for="MyCheckbox">test</label><input id="MyCheckbox"
type="checkbox" name="MyCheckbox" /></span>
Identical code works for text boxes and list boxes, but
not for checkboxes or radiobuttons (or groups). I know
HTML supports the onfocus event for these two controls.
Any ideas?
Thanks, Paul.
I need to set up the onfocus event for a checkbox and
radiobutton server control from the codebehind page. I am
trying something like:
this.MyCheckbox.Attributes.Add("onfocus", "alert
('gotit');");
or
this.MyCheckbox.Attributes["onfocus"] = "alert
('gotit');");
but neither work.
As you can see in the generated code the onfocus seems to
apply to a span tag, not directly to the controls
themselves:
<span onFocus="alert('gotit');"><label
for="MyCheckbox">test</label><input id="MyCheckbox"
type="checkbox" name="MyCheckbox" /></span>
Identical code works for text boxes and list boxes, but
not for checkboxes or radiobuttons (or groups). I know
HTML supports the onfocus event for these two controls.
Any ideas?
Thanks, Paul.