Click to See Complete Forum and Search --> : radio button problems


coffeebrown83
05-01-2003, 07:48 PM
how do i get the raido button to send its value back so that the user may be directed to the webpage that refers to their subject? thank You


<html>

<head>
<title></title>
</head>

<body background=images/kewl.jpg text="#000000" link="#0033FF" vlink="#00CCFF" alink="#FF0000">

<SCRIPT LANGUAGE ="Javascript" >

<!-- Start hifing Javascript statements

function ValidateOrder(myForm) {

if (myForm.First_name.value=="")
{
window.alert("Missing First name! Please correct");
myForm.First_name.focus();
return(false);
}

if (myForm.Last_name.value=="")
{
window.alert("Missing Last name! Please correct");
myForm.Last_name.focus();
return(false);
}

if (myForm.address.value=="")
{
window.alert("Missing Address! please correct");
myForm.address.focus();
return(false);
}

if (myForm.city.value=="")
{
window.alert("Missing City! please correct");
myForm.city.focus();
return(false);
}

if (document.myForm.state.value== "")
{
window.alert("Missing State! please correct");
myForm.state.focus();
return(false);
}

if (document.myForm.zip.value.length < 1){
window.alert("Missing zip! please correct");
myForm.zip.focus();
return(false);
}


option_selected= "no"

for (i=0; i < document.myForm.radio_option1.length; i++) {
if (document.myForm.radio_option1[i].checked){
option_selected= "yes";
}
}

if (option_selected == "no"){
window.alert( "You must select a subject. Please correct!");
return(false);
}

'window.alert( "Your information looks correct, lets move on!");
if (myForm.radio_option1.Value == "Booking"){
setTimeout('document.location="http://www.yahoo.com"',1000);
}
if (myForm.radio_option1.Value == "Other"){
setTimeout('document.location="http://www.msn.com"',1000);
}

return(true);
}


// End hiding Javascript-->
</SCRIPT>



<form method="post" onSubmit="return ValidateOrder(this)" name= "myForm" ACTION="mailto:coffeebrown83@hotmail.com" Enctype="text/plain">
<font face="Tahoma" size="3">Please Complete the following information
form for more information regarding pricing. Then select next. Thank
you!</font>
<p><font face="Tahoma" size="2">
<B> First Name:</B> <INPUT NAME="First_name" type="text" size="23" maxlength="25">&nbsp;
<B> Last Name:</B> <INPUT NAME="Last_name" type="text" size="24" maxlength="25">
</font></p>
<p><font face="Tahoma" size="2"><b> Mailing Address:</b>
<INPUT NAME="address" type="text" size="43" maxlength="50"><br>
<BR>
<b> City:</b> <INPUT NAME="city" type="text" size="20" maxlength="50">&nbsp;&nbsp;
<b>State:</b> <INPUT NAME="state" type="text" size="4" maxlength="2">&nbsp;&nbsp;&nbsp;&nbsp;
<b>Zip:</b> <INPUT NAME="zip" type="text" size="9" maxlength="5">&nbsp;</font></P>

<P><b><font face="Tahoma" size="2">What is the Subject of this Inquiry?</font></b></p>
<font face="Tahoma" size="2">
<INPUT NAME="radio_option1" TYPE="radio" Value="Booking">Booking Inquiries<BR>
<INPUT NAME="radio_option1" TYPE="radio" Value="Other"> Other Inquiries<BR>

</font>

<P><B><font face="Tahoma" size="2">Questions and or Comments:</font> </b></p>
<font face="Tahoma" size="2">
<TEXTAREA NAME="myTextArea" Type="textarea" rows="4" cols="46">
</TEXTAREA>
<br>
<br>
<INPUT type="reset" value="Reset Form">
<INPUT Type="submit" Value="Submit" >
</font>


</body>

</html>

coffeebrown83
05-01-2003, 08:51 PM
why did you include
if(myForm.radio_option1[0].checked
&& myForm.radio_option1[0].value == "Booking"){
setTimeout('document.location="http://www.yahoo.com"',1000);
}
if(myForm.radio_option1[1].checked
&& myForm.radio_option1[1].value == "Other"){
setTimeout('document.location="http://www.msn.com"',1000);
}

coffeebrown83
05-01-2003, 08:55 PM
yes, it works. but this is a project for school and i was just curious as to why you put the counter on the end

coffeebrown83
05-01-2003, 09:03 PM
oh ok thanks

coffeebrown83
05-01-2003, 10:59 PM
how can i refrence or link to a page that is mine, not something that is alreay on the interent without typing out the full path, because it may changein the near future?

f(myForm.radio_option1[0].checked && myForm.radio_option1[0].value == "Booking"){
setTimeout('document.location="Booking.htm"',1000);
}
if(myForm.radio_option1[1].checked && myForm.radio_option1[1].value == "Other"){
setTimeout('document.location="Thankyou.htm"',1000);
}

coffeebrown83
05-02-2003, 07:53 AM
Originally posted by Dave Clark
If you mean something that is on your local computer, you must use the full path if you're trying to reference it from a web page. If you load the HTML page from your local computer, then a relative path will work in that case.

Dave

its something on my local computer that i want to refrence in a webpage on my local computer, that will be posted to the web in near future

coffeebrown83
05-02-2003, 05:18 PM
:confused: :( :mad: :confused:
i tried that, but it didn't work
thanks for all your help

coffeebrown83
05-02-2003, 05:21 PM
it worked!!!!!