I'm trying to pass a variable gathered from a radio button and all day i've been stuck on something that seems so small, maybe i've been staring too long.
No matter what radio that is checked it's resulting as 0.
Here's the button
Then where i'm trying to get and set selected.Code:<div ID="dCloneTypeSelect" name="dCloneTypeSelect" style="border: 1px solid black; padding: 0px; position: absolute; visibility: hidden;""> <table bgcolor="#ffffff"> <tr> <td> <span style="color:black; font-family:verdana; font-size:8pt; font-weight:normal"> <b>How would you like to clone?</b><br> <input type=radio id = "rdoClonewHours" name="CloneSelect" value="0" > Clone with Hours <br> <input type=radio id = "rdoCloneNoHours" name="CloneSelect" value="1" > Clone without Hours <br></span> <center> <input type=button value="Clone" style="font-size: 8pt;" onclick="CloneFromTypeSelect()" id=button1 name=button1> <input type=button value="Cancel" style="font-size: 8pt;" onclick="HideCloneTypeSelect('btnClone')" id=button2 name=button2><br> </center> </td> </tr> </table> </div>Then where i am trying to use the type. Which works if i can get 0 or 1, it's the function above that needs work.Code:function GetCloneType() { var CloneType = 0; if (document.getElementById("rdoClonewHours").checked) CloneType = 0; else if (document.getElementById("rdoCloneNoHours").checked) CloneType = 1; //alert (CloneType); return CloneType; }
No matter what i modify i keep getting 0, suggestions?!Code:function CloneTS() { var CloneSelect = GetCloneType() if (CloneSelect == 0) { var confirm_clonewhours = confirm ("You are cloning codes and hours from last pay period, not including any leave hours, do you wish to continue?"); if (confirm_clonewhours == false) { document.getElementById("dCloneTypeSelect").style.visibility = 'visible'; document.getElementById("rdoClonewHours").checked = true; } } else if (CloneSelect == 1) { var confirm_clonenohours = confirm ("You are cloning codes only from last pay period, not including any leave codes, do you wish to continue?"); if (confirm_clonenohours == false) { document.getElementById("dCloneTypeSelect").style.visibility = 'visible'; document.getElementById("rdoCloneNoHours").checked = true; } } }


Reply With Quote


Bookmarks