oat
02-07-2003, 04:52 PM
Hi folks,
I am stumped, there is something painfully simple going wrong here, and i cant see it. I will feel like a fool when somebody points it out to me :o
anyway, i am just trying to reference a radio button in a form. And its not working. Heres the code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function VerifyData()
{
var test=0;
var test=document.payform.package.value;
window.alert(test);
return true
}
</script>
</head>
<body>
<form name="payform" onSubmit="return VerifyData()" method=POST>
<table border="1" cellpadding="0" cellspacing="0" width="460">
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>Package</b></font></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>No.
of Units</b></font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>Cost
(£)</b></font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>Cost
($USD and Euro)</b></font></td>
</tr>
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">
<input type="radio" name="package" value="1" CHECKED>
</font></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">5</font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">7.99 </font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">16.99</font></td>
</tr>
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid">
<input type="radio" name="package" value="2"></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">10</font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">12.99 </font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">21.99</font></td>
</tr>
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid">
<input type="radio" name="package" value="3"></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">25</font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">29.99 </font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">49.99</font></td>
</tr>
</table>
<input type="submit">
</form>
</body>
</html>
any help would be v appreciated
oat
I am stumped, there is something painfully simple going wrong here, and i cant see it. I will feel like a fool when somebody points it out to me :o
anyway, i am just trying to reference a radio button in a form. And its not working. Heres the code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function VerifyData()
{
var test=0;
var test=document.payform.package.value;
window.alert(test);
return true
}
</script>
</head>
<body>
<form name="payform" onSubmit="return VerifyData()" method=POST>
<table border="1" cellpadding="0" cellspacing="0" width="460">
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>Package</b></font></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>No.
of Units</b></font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>Cost
(£)</b></font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2"><b>Cost
($USD and Euro)</b></font></td>
</tr>
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">
<input type="radio" name="package" value="1" CHECKED>
</font></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">5</font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">7.99 </font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">16.99</font></td>
</tr>
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid">
<input type="radio" name="package" value="2"></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">10</font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">12.99 </font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">21.99</font></td>
</tr>
<tr>
<td width="82" style="border-left-style: solid; border-top-style: solid">
<input type="radio" name="package" value="3"></td>
<td width="102" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">25</font></td>
<td width="87" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">29.99 </font></td>
<td width="179" style="border-left-style: solid; border-top-style: solid"><font face="Arial" color="#666666" size="2">49.99</font></td>
</tr>
</table>
<input type="submit">
</form>
</body>
</html>
any help would be v appreciated
oat