If Then from 2 checkboxes

  • Thread starter Thread starter dancer
  • Start date Start date
D

dancer

I have 2 check boxes as following:

<td align= "left">
<font face="Verdana" Size="2">Employee <asp:CheckBox id=Check5
runat="server" />

<br>
Non-employee <asp:CheckBox id="Check6" runat="server" />

I need to make a variable "employeeornon" that I could say if check5 is
checked, then employeeornon = "employee" and write "employee".
else if check6 is checked, then employeeornon = "non-employee" and write
"non-employee'.

Can you point me in the right direction?
 
Try this:

Put this in the aspx code


<INPUT id="hidMyHidden" type="hidden" name="hidMyHidden" runat="server">



on the code behind, wire up JAVASCRIPT events. so when the checkbox is
clicked , it will write out a value to the hidden box above.


something like

Check6.Attributes.Add("onClick" ,
"document.getByElementID('Check6').value='employee'" ) ;

going from memory , so take it with a grain of salt.


I'm not sure exactly what you're trying to do, so maybe rework your post
with more details.
 
Back
Top