View Single Post
Old 11-06-2012, 12:31 AM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Because your code is doing it!

You are doing onClick="sizeSelection='Small'" so you *ARE* setting the (now global) variable sizeSelection according to what was clicked on.

When you were doing
Code:
    sizeSelection = document.getElementByName('size').value;
that code was wrong and was WIPING OUT the value that the onclick had already put there.

When you are ready, go looking (you can search in this forum) for how to get the value of the checked radio button in a set of radio buttons. Then you won't need the onclick handlers any more.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote