Macca
03-10-2009, 12:13 PM
I have an HTML form with JavaScript validation.
What I have been trying to solve is displaying the value of radio buttons when the form has been completed and sent (by email).
function checkRIF(theForm)
{
var data = document.ChargeRequest;
var userinfo = "";
var sender = data.fullname.value;
theForm.action += "?charge=" + data.fullname.value;
userinfo += "\n\nPage Title: " + document.title + "\n\n";
theForm.mailbody.value = userinfo + "PART A: " + "\n\n" + "text1: " + data.text1.value + "\n\n" + "radio button: " + data.radio.checked ";
return true;
}
I get 'undefined' when the form is submitted. Can someone help me capture the value of the radio button?
<body>
<p>Yes
<input type="radio" name="radio" id="radio1" value="Yes">
No
<input type="radio" name="radio" id="radio2" value="No">
</p>
</body>
What I have been trying to solve is displaying the value of radio buttons when the form has been completed and sent (by email).
function checkRIF(theForm)
{
var data = document.ChargeRequest;
var userinfo = "";
var sender = data.fullname.value;
theForm.action += "?charge=" + data.fullname.value;
userinfo += "\n\nPage Title: " + document.title + "\n\n";
theForm.mailbody.value = userinfo + "PART A: " + "\n\n" + "text1: " + data.text1.value + "\n\n" + "radio button: " + data.radio.checked ";
return true;
}
I get 'undefined' when the form is submitted. Can someone help me capture the value of the radio button?
<body>
<p>Yes
<input type="radio" name="radio" id="radio1" value="Yes">
No
<input type="radio" name="radio" id="radio2" value="No">
</p>
</body>