RonMcIntire
01-20-2009, 05:14 PM
All:
I've got a glitch somewhere and it's not obvious to me. Maybe someone can spot it.
My problem is that the functions seem to return values but don't display them like they should. I'm testing returned values with a function called sayvalue(item). But when I test "DelTimeCode" the function returns "[Object]". I don't understand. I get returned values from DelTime and DelTitle.
My approach is to select a radio button option, return a delivery title and a delivery price from the appropriate functions then write the information.
I think I'm close. Any suggestions or observations of an error in my code?
I have the following VARIABLES and FUNCTIONS:
<head>
var AmtSV;
var DelTimeCode="";
var DelTime="";
var DelTitle="";
<script language="text/javascript">
function sayvalue(item)
{
alert(item);
}
function getAmtSV(code) {
if (code=='SV01') { AmtSV=AmtSV01;}
return ("$ " + AmtSV + ".00");
alert(AmtSV)
}
function getDelTitle(code) {
if (code=='SV01') { DelTitle="Regular Delivery - 8 Hour Window" }
return (DelTitle);
}
function getDelTime(code) {
if (code=='SV01') {DelTime="8A-5P: 8 Hour Window" }
return DelTime;
}
</script>
A group of RADIO BUTTONS: (Sample)
<body>
<input type="radio" name="DelTimeCode" value="SV01" onclick ="getDelTime('SV01'); getDelTitle('SV01'); getAmtSV('SV01'); sayvalue(DelTimecode)" > 8A-5P: 8 Hour Window ($50)</p>
I wish to WRITE THE DATA with the following code:
<td
<b><script type="text/javascript"> document.write(DelTitle); </script></b>
</td>
<td
<b><script type="text/javascript"> document.write(AmtSV); </script></b>
</td>
I've got a glitch somewhere and it's not obvious to me. Maybe someone can spot it.
My problem is that the functions seem to return values but don't display them like they should. I'm testing returned values with a function called sayvalue(item). But when I test "DelTimeCode" the function returns "[Object]". I don't understand. I get returned values from DelTime and DelTitle.
My approach is to select a radio button option, return a delivery title and a delivery price from the appropriate functions then write the information.
I think I'm close. Any suggestions or observations of an error in my code?
I have the following VARIABLES and FUNCTIONS:
<head>
var AmtSV;
var DelTimeCode="";
var DelTime="";
var DelTitle="";
<script language="text/javascript">
function sayvalue(item)
{
alert(item);
}
function getAmtSV(code) {
if (code=='SV01') { AmtSV=AmtSV01;}
return ("$ " + AmtSV + ".00");
alert(AmtSV)
}
function getDelTitle(code) {
if (code=='SV01') { DelTitle="Regular Delivery - 8 Hour Window" }
return (DelTitle);
}
function getDelTime(code) {
if (code=='SV01') {DelTime="8A-5P: 8 Hour Window" }
return DelTime;
}
</script>
A group of RADIO BUTTONS: (Sample)
<body>
<input type="radio" name="DelTimeCode" value="SV01" onclick ="getDelTime('SV01'); getDelTitle('SV01'); getAmtSV('SV01'); sayvalue(DelTimecode)" > 8A-5P: 8 Hour Window ($50)</p>
I wish to WRITE THE DATA with the following code:
<td
<b><script type="text/javascript"> document.write(DelTitle); </script></b>
</td>
<td
<b><script type="text/javascript"> document.write(AmtSV); </script></b>
</td>