radio button, check for use

F

frits

I have the following code:

<input type="radio" id="q1" name="q1" value="Yes">
<input type="radio" id="q1" name="q1" value="No">

Now I want to check if the button q1 is used so the code must be extended.
When the button is not used, the value must be "q1 not used".

How can I do that? I will not use the "checked" option in the code if it is
showed in the site.
When there is a hidden "checked" option than the value of q1 is always "q1
not used" what can be a solution....

Frits
 
A

Adrienne Boswell

I have the following code:

<input type="radio" id="q1" name="q1" value="Yes">
<input type="radio" id="q1" name="q1" value="No">

Now I want to check if the button q1 is used so the code must be
extended. When the button is not used, the value must be "q1 not
used".

How can I do that? I will not use the "checked" option in the code if
it is showed in the site.
When there is a hidden "checked" option than the value of q1 is always
"q1 not used" what can be a solution....

Frits

<input type="radio" id="q1" value="Yes" name="q1">
<input type="radio" id="q2" value="q1 not checked" name="q1">

Please note that the id attribute must be unique for each element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,853
Latest member
GeorgiaSta

Latest Threads

Top