BluewaterRocket
New member
Is it possible to set a property in an ASP WebControl from a client side script ?(i.e. Jscript or VBScript). Id like to change the value of the visibility property of a CheckBoxList based upon another checkbox webcontrol event (onChange).
I tried adding an event attribute to the web control (the checkbox) as follows:
chkEmail.Attributes.Add("onchange", "emailDisplay();")
The above was placed in Page_Load
The emailDisplay() script is put in the HEAD of the document as follows:
<script language="VBScript">
Sub emailDisplay ()
if chkEmail.checked = true then
CheckBoxListEmail.Visible = true
else
CheckBoxListEmail.Visible = false
end if
end sub
</script>
Im a pretty green newbie with ASP and HTML scripting, I suspect the semantics of the script are not correct . Dont know if its possible to reference web controls from this client side script.
I load the page w/ visible=false, changing the checkbox does not change the CheckBoxList visible property to true.
Any help appreciated
I tried adding an event attribute to the web control (the checkbox) as follows:
chkEmail.Attributes.Add("onchange", "emailDisplay();")
The above was placed in Page_Load
The emailDisplay() script is put in the HEAD of the document as follows:
<script language="VBScript">
Sub emailDisplay ()
if chkEmail.checked = true then
CheckBoxListEmail.Visible = true
else
CheckBoxListEmail.Visible = false
end if
end sub
</script>
Im a pretty green newbie with ASP and HTML scripting, I suspect the semantics of the script are not correct . Dont know if its possible to reference web controls from this client side script.
I load the page w/ visible=false, changing the checkbox does not change the CheckBoxList visible property to true.
Any help appreciated