473,386 Members | 1,733 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,386 software developers and data experts.

To check a radio

Bob
Hi at all

I have a radio group with 3 options

<input type="radio" value first" name="first" id="choices">

<input type="radio" value="second" name="second" id="choices">

<input type="radio" value="three" name="three" id="choices">

Is it possible to check the second using getelementbyid?

How?

Thank in advance

Jul 28 '07 #1
5 1460
On Jul 28, 4:27 am, "Bob" <b...@nospam.comwrote:
Hi at all

I have a radio group with 3 options

<input type="radio" value first" name="first" id="choices">

<input type="radio" value="second" name="second" id="choices">

<input type="radio" value="three" name="three" id="choices">

Is it possible to check the second using getelementbyid?
You seem to be confused in a couple of ways. ID's must be unique.
Form element names do not. A radio group with different names for
each button is useless.
>
How?
Give it a unique id. Then you can find it with gEBI and set its
checked property.

Jul 28 '07 #2
Bob
-z54uj
My problem is different

In a certain point of a HTML page I have a radio group

with 3 radio button

At an other point of the page I have an <input type=text

If the user enter a certain value I want to check the second radio button.
Jul 28 '07 #3
rf

"Bob" <bo*@nospam.comwrote in message
news:7S*******************@twister2.libero.it...
-z54uj
My problem is different
Different to what?
In a certain point of a HTML page I have a radio group

with 3 radio button
No you don't. Not if you are referring to that code you posted. You have
three totally unrelated radio buttons.
At an other point of the page I have an <input type=text
Fine.
If the user enter a certain value I want to check the second radio button.
Then you will access it via getElementById, with it's unique id, just like I
showed you.

Did you read those references I gave you?

--
Richard.
Jul 28 '07 #4
Bob

"rf"
wrote
Did you read those references I gave you?

--
Richard.
Yes!
Thank you very much!
Jul 28 '07 #5
David Mark wrote:
Give it a unique id. Then you can find it with gEBI and set its
checked property.
Or, more compatible, use the common iteration approach.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Aug 1 '07 #6

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

Similar topics

15
by: tabonni | last post by:
I want to check each button groups and save the checked value into a 2 dimensional array. But, it doesn't work. Could anyone tell me what's wrong with my code. My code is as follow: <html>...
2
by: jimi_xyz | last post by:
Sorry if this isn't the correct group, i don't think there is a group for straight HTML. I am trying to create a type of search engine. There are two radio buttons at the top, in the middle there...
4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
3
by: Harry Haller | last post by:
I have a radio button group. When the page loads none of them are selected. OnClick selects ONE and clicking another one selects a different one - this is normal behavior. I want to modify it so...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.