okay this is quite simple i'm sure, but i can't manage to get it.
if somebody could just do stuff for something basic like this, so i can understand how on earth radio buttons are worked with:
there are 3 radio buttons for...say...marital status. when a button is clicked, just alert the status. i tried a script with all the combinations of ifs and elses and radio button names and ids i could think of. here's one of my tries.
Your marital status:
<input type="radio" name="r" value="no"> Single
<input type="radio" name="r" value="no"> Married
<input type="radio" name="r" value="no"> Divorced
<input type="button" value="submit" onClick="alertstatus()">
WHY doesn't it work??
when i use if-else, it always executes only the else phrase, no matter what button is checked. if i use only ifs, as above, nothing executes. i never managed to make anything work with if-else if-else. (maybe that's not the right syntax?)