473,320 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

If Then from 2 checkboxes

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?
May 15 '07 #1
2 1008

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.

"dancer" <da****@microsoft.comwrote in message
news:e7**************@TK2MSFTNGP04.phx.gbl...
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?


May 15 '07 #2
I don't have a code behind. Everything is on 1 page.
"sloan" <sl***@ipass.netwrote in message
news:OA**************@TK2MSFTNGP02.phx.gbl...
>
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.

"dancer" <da****@microsoft.comwrote in message
news:e7**************@TK2MSFTNGP04.phx.gbl...
>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?



May 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pete | last post by:
There is a Summary/Example further down... On page one of my site I have a form with some checkboxes and detailed descriptions. When the form is submitted (to page two), the values of the...
4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
8
by: Ralph Freshour | last post by:
I have multiple checkbox's created with an array name because I have many on the same web page - their names are like: frm_chk_delete frm_chk_delete frm_chk_delete frm_chk_delete etc. Here...
5
by: @(none) | last post by:
I have a page which is a set of CheckBoxes generated daily and thus the number of Checkboxes changes each day. What I want to do is allow the user to select one or more checkboxes and the push a...
6
by: terence.parker | last post by:
I currently have the following JS in my header: function checkall(thestate) { var checkboxes=eval("document.forms.EssayList.file_id") for (i=0;i<checkboxes.length;i++)...
12
by: Tobias Froehlich | last post by:
Hi, I have a form called form1 on which there are a lot of checkBoxes (they form a 8x6 field). I'd like to create a class in a seperate .cs file which gives some control over these checkBoxes...
2
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the...
11
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
5
by: masterej | last post by:
Developers, Is there any way to disable all checkboxes on a form? I have a form with 160 checkboxes and I want to be able to disable all of them. Is there a way I can do something like this: ...
7
by: viki1967 | last post by:
I need one function javascript that: 1) when I enter in this htm page I see enabled only checkbox of categories A, M and T; checkboxes of microcategories all disabled; 2-a) If I select the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.