/    Sign up×
Community /Pin to ProfileBookmark

Two radio buttons with the same name

Hi all!

I have this source:

<font face=”Arial, Helvetica, sans-serif” size=”2″><span >
<input type=”radio” name=”radioKeyType” value=”Ascii” onClick=”OnClickHandlerEncrypKeyType()” checked>
ASCII </span></font>

<font face=”Arial, Helvetica, sans-serif” size=”2″><span></span>
<input type=”radio” name=”radioKeyType” value=”Hex” onClick=”OnClickHandlerEncrypKeyType()”>
Hexadecimal </font></td>

I a C++ program that I had wrote, I can manage the page and to “choose” one of this buttons to be checked.

How can I do this if the two buttons have the same name??

Thanks a lot

David

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@PittimannJan 19.2005 — Hi again!

Radio buttons with the same name build a group and are elements of an array. Assuming that your radios are situated in a form with the name="example", the referencing could look like this:

document.example.radioKeyType[0]// the first radio

document.example.radioKeyType[1]// the second radio

Hope, that helps.

Cheers - Pit
Copy linkTweet thisAlerts:
@bezaleliauthorJan 19.2005 — I am glad to meet you again.

As usual, your answer was exact.

My code (in this point) is now working.

Mant thanks for your help.

See you again (maybe today...)

David
Copy linkTweet thisAlerts:
@PittimannJan 19.2005 — Nice to hear, that your code (in this point) is working. ?

See you (whenever) - Pit
×

Success!

Help @bezaleli spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...