Hello to all...
I made 2 radio buttons
<input type="radio" name="rad" value="val">
<input type="radio" name="rad2" value="val2">
How can i make when i will check the first radio button , automatically check the second?
thanks
2 radio buttons
Moderator: General Moderators
Re: 2 radio buttons
Give them the same name.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: 2 radio buttons
not working 
but i don't want like this
edit:
i didnt test correctly
)
it worked ... but not like i want to , but still, it's good
thx 
but i don't want like this
Code: Select all
<input type="radio" name="radio1" value="1" onclick="selectAnother();" id="radio1">
<input type="radio" name="radio2" value="1" id="radio2">
<script>
function selectAnother()
{
var radio1 = document.getElementById('radio1');
var radio2 = document.getElementById('radio2');
if(radio1.checked)
{
radio2.checked = true;
}
}
</script>edit:
i didnt test correctly
it worked ... but not like i want to , but still, it's good