Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

taxi quote system. help needed to reload a page.

Status
Not open for further replies.

tonyx666

MIS
Apr 13, 2006
214
GB
hello, i have had much help from these forums and am forever grateful for the time and stress that they have saved me in the past.

i have a quote system for my website that i wish to develop.

i like the idea of pages that refresh instantly with new data if something is pressed and that is what i want to learn to do.

the page is here http://www.londonheathrowcars.com/blankquote.asp

basically i want to begin to understand how the 'refresh page' thing can be acheived without redirecting my user to another page...

here is the code for that simple page. if someone could tell me what step i would need to take to ensure that the page refreshes when one of the radio buttons is selected..

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]

<html>
<head>
<title> | </title>

<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="external.js"></script>
<script type="text/javascript" src="menu.js"></script>



</head>
<body>

	<div id="wrap">
		
		

<div id="bleft">
	<h1 class="top">Online Quote Finder</h1>
	<form name="form" method="post" action="none-yet.asp" onSubmit="return IsQuoteFormComplete()">
			<p class="mainbody">Please choose your type of journey to get a quote:</p><br>
				<form name="form" method="post" action="redirect.asp" onSubmit="return IsQuoteFormComplete()">
				<p class="mainbody">
					<input type="radio" VALUE="v2" name="r1" onMouseOver="style.cursor='pointer'">&nbsp;&nbsp;&nbsp;Travel From Heathrow	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp	<input type="radio" VALUE="v1" name="r1" onMouseOver="style.cursor='pointer'">&nbsp;&nbsp;&nbsp;Travel To Heathrow<br>
					

</form>
<br><br><br>
</div>


<div id="bright">
	
</div>


			
	</div>

</body>




</html>

thanks in advance for any solutions..

kiss first.. cum later
 
http://www.londonheathrowcars.com/ajax/blankquote.asp

ok i think im gettin somewhere, it is startin quicker and easier which is good..

the reason i dont like that fact that everything is in a different page is because under the car details there will be a button that says.. get quote..

now i have an asp page.. it is this infact

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<% 
'SET-UP AND DECLARE VARIABLES TO GATHER
'FORM INFO FROM PAGE1.ASP

DIM sPostCode, sCarSelection, sCarModel

sPostCode = trim(request.form("postcode"))
sCarSelection = ucase(request.form("car1"))

'RUN A CONDITION SO THAT THE CAR SELECTED CODE
'IS OUTPUTTED TO THE SCREEN AS THE MODEL OF THE CAR CODE

if sCarSelection = "C1" then
sCarModel = "Saloon"
elseif sCarSelection = "C2" then
sCarModel = "Estate"
elseif sCarSelection = "C3" then
sCarModel = "People Carrier"
elseif sCarSelection = "C4" then
sCarModel = "Executive"
end if



 
'DECLARE CONNECTION VARIABLES

DIM myconn, connection, rs

set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select price from h2t where cartype = '" & sCarSelection & "' and destination = '" & sPostCode & "' ", myconn
%>
<html>
<head>

</head>
<body>

	<%
DIM sTempVar

sTempVar = "&#"
%>
<p class="mainbody">Listed below are the details of your journey:</p><br>
<p class="mainbody">Pickup: <b>Heathrow</b><br><br>Destination: <b><%=sPostCode%></b><br><br>Car: <b><%=sCarModel%></b><br><br>Price: <b><%=sTempVar & "163;" & trim(rs("price"))%></b></p>
<br>
</body>
</html>

if i create a button on the blankquote.asp page.. will it be able to read all the values selected on the form's individual containers/pages.. to get a quote from my database??

come on the gunners!
 
yes you can read all the values as though you loaded the page with them there already... its the same thing accept the content was loaded w/ ajax... just make sure you have <form action="thispage.asp"> </form> around your whole page of the main content... also i have noticed that in the content you are loading with ajax the quote1.asp page etc you are doing <html><body> tags on that page... like i said on a previous post you don't have to do this because you already have this on your main page... and you are just making it load more then it has to not to mention it is improper html structure if you do that...

jason

Army : Combat Engineer : 21B

 
that is great, thank you..

its 2am

tomorrow is a new day.. i will get the actual quote system working.. and hopefully there will just be one thing left i need to ask you.. but we will leave that till then.. thank you very much for your help by the way..

come on the gunners!
 
ok jason i think i need ur help again.. or someone..

this is not exactly how the page will look but im just trying to get it working at the moment..

you said that even tho everything is in different pages within my main page it should work.. but it isnt.. i have checked my code.. and things SEEM to be named correctly.. and i know the db is workin because it populates the drop downs properly..

so if you could do this form me.. choose the first radio.. 'london postcode' and proceed from there.. when you click the get quote that error comes up

you have any idea what could be causin it


come on the gunners!
 
could you do me a favour.. clear ur cache then do it again.. if you choose 'London Postcode', and continue from there it should not redirect to anything.. it should just load a 'price.asp' page in a new container under the original radio buttons on the left.. and it should show this error '80020009'

come on the gunners!
 
Well the error you are getting is an ASP error, so can you post your ASP code...this error could be from a number of things... like no records in the table you are calling... etc but it could be a number of things... its an ADODB error

Jason

Army : Combat Engineer : 21B

 
ok.. here is the blankquote.asp page code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]

<html>
<head>
<title> | </title>

<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="external.js"></script>
<script type="text/javascript" src="ajax.js"></script>



</head>

<body>
<div id="wrap">
		
		

<div id="bleft">
<h1 class="top">Quick Quote</h1>
<form name="quoteform">
<p class="mainbody">1. Please Choose a Destination:<br><Br>
		<input type="radio" VALUE="v1" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadPostcodes();">&nbsp;&nbsp;&nbsp;<b>London Postcode</b> (N1, WC2, E14 etc..)<br><br>

		<input type="radio" VALUE="v2" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadContent2()";>&nbsp;&nbsp;&nbsp;<b>Town / Location</b> (Cambridge, Brighton etc..)<br><br>
		
		<input type="radio" VALUE="v3" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadAirports()";>&nbsp;&nbsp;&nbsp;<b>UK Airport</b> (Gatwick, Stansted etc..)<br><br>
		
		<input type="radio" VALUE="v4" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadSeaports()";>&nbsp;&nbsp;&nbsp;<b>UK Seaport</b> (Dover, Harwich etc..)<br><br>



<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="newpricehere"></td>
  </tr>
</table>
</div>


<div id="bright">
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="thecellid"></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="carcontentid"></td>
  </tr>
    <tr>
    <td id="buttonid"></td>
  </tr>
</table>
</form>

</div>


			
</div>
</body>
</html>

and if we go through the process.. you click the first radio button and quote1.asp loads.. its here..

quote1.asp
Code:
<%
set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select townNAME from tblTOWN", myconn
%>
<script type="text/javascript" src="ajax.js"></script>
<h1 class="top">Travel From Heathrow</h1>
<p class="mainbody">2. Select a <b>London Postcode</b>:<br>
    <select class="droppy" name="postcode" onChange="LoadCarContent();">
<option value="">...</option>
<%
if not rs.eof then
do until rs.eof
%>
<option class="grey" value="<%=rs("townName")%>"><%=rs("townName")%></option>
<%
rs.movenext
loop
end if
%>
</select>
</p>

then when you choose a postcode the car choices come up here..


cars.asp
Code:
<script type="text/javascript" src="ajax.js"></script>
<br>
<p class="mainbody">3. Choose a <b>Vehicle</b>:<br><br>
<input type="radio" VALUE="c1"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Saloon</b> (1-4 Passengers - 3 Suitcases)
<br><br>
<input type="radio" VALUE="c2"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Estate</b> (1-4 Passengers - 4 Suitcases)
<br><br>
<input type="radio" VALUE="c3"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>People Carrier</b> (1-6 Passengers - 5 Suitcases)
<br><br>
<input type="radio" VALUE="c4"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Executive</b> (1-4 Passengers - 3 Suitcases)
<br><br>


and when you choose a car the button comes up here..

button.asp
Code:
<script type="text/javascript" src="ajax.js"></script>
<p><input style="margin-top:20px;margin-bottom:30px;margin-left:35px;background-color:#666666;font-weight:bold;font-size:12px;font-family:arial;color:white;width:100px;" value="Get Quote" name="B1" type="submit" onclick="GetPrice();"></p>
<Br><br><br>

then when you click it it loads the price.asp page here


price.asp
Code:
<h1 class="top">Hello</h1>

<%
DIM sPostCode, sCarSelection, sCarModel

sPostCode = trim(request.form("postcode"))
sCarSelection = ucase(request.form("car1"))

if sCarSelection = "C1" then
sCarModel = "Saloon"
elseif sCarSelection = "C2" then
sCarModel = "Estate"
elseif sCarSelection = "C3" then
sCarModel = "People Carrier"
elseif sCarSelection = "C4" then
sCarModel = "Executive"
end if


DIM myconn, connection, rs

set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select price from h2t where cartype = '" & sCarSelection & "' and destination = '" & sPostCode & "' ", myconn
%>

<%
DIM sTempVar
sTempVar = "&#"
%>
<p class="mainbody">Listed below are the details of your journey:</p><br>
<p class="mainbody">Pickup: <b>Heathrow</b><br><br>Destination: <b><%=sPostCode%></b><br><br>Car: <b><%=sCarModel%></b><br><br>Price: <b><%=sTempVar & "163;" & trim(rs("price"))%></b></p>
<br>
</body>
</html>

finally here is the ajax.js file..
Code:
function createRequestObject() {
    var ro;
    /*@cc_on
    @if (@_jscript_version >= 5)
        try {
            ro = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                ro = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                ro = false;
            }
        }
    @else
        ro = false;
    @end @*/
    if (!ro && typeof XMLHttpRequest != 'undefined') {
        try {
            ro = new XMLHttpRequest();
        } catch (e) {
            ro = false;
        }
    }
    return ro;
}


var xmlHttp = null;
function LoadPostcodes() {
        xmlHttp = createRequestObject();
        var url="quote1.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}


var xmlHttp = null;
function LoadContent2() {
        xmlHttp = createRequestObject();
        var url="quote2.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}

var xmlHttp = null;
function LoadAirports() {
        xmlHttp = createRequestObject();
        var url="quote3.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}


var xmlHttp = null;
function LoadSeaports() {
        xmlHttp = createRequestObject();
        var url="quote4.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}


function LoadContentComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('thecellid').innerHTML = xmlHttp.responseText;
   }
}


function LoadCarContent() {
        xmlHttp = createRequestObject();
        var url="cars.asp";
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadCarContentComplete;
        xmlHttp.send('');
}


function LoadCarContentComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('carcontentid').innerHTML = xmlHttp.responseText;
   }
}


function LoadButton() {
        xmlHttp = createRequestObject();
        var url="button.asp";
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadButtonComplete;
        xmlHttp.send('');
}


function LoadButtonComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('buttonid').innerHTML = xmlHttp.responseText;
   }
}


function GetPrice() {
        xmlHttp = createRequestObject();
        var url="price.asp";
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = GetPriceComplete;
        xmlHttp.send('');
}


function GetPriceComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('newpricehere').innerHTML = xmlHttp.responseText;
   }
}

come on the gunners!
 
ohhh okay... I didnt understand when you said will my form fields work... I thought you ment you were posting to another page.... if you are going to do what you are doing by posting to the page, then you have to throw them through the ajax function like so... If you have alot of information to pass... like more than a few values then you may want to do an AJAX post. But it looks to me like you can still use a querystring for what you are doing...




Code:
function GetPrice() {
       [highlight]  var RadioButtonValue = document.quoteform.car1.value; [/highlight]
        xmlHttp = createRequestObject();
       [highlight] var url="price.asp?PASSMYVALUE=" + RadioButtonValue; [/highlight]
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = GetPriceComplete;
        xmlHttp.send('');
}

Army : Combat Engineer : 21B

 
ok i changed that function and it now tells me that


document.quoteform.car1 has no properties

so i tried giving the car form a name like below but got the same problem

Code:
<script type="text/javascript" src="ajax.js"></script>
<br>
<form name="quoteform">
<p class="mainbody">3. Choose a <b>Vehicle</b>:<br><br>
<input type="radio" VALUE="c1"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Saloon</b> (1-4 Passengers - 3 Suitcases)
<br><br>
<input type="radio" VALUE="c2"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Estate</b> (1-4 Passengers - 4 Suitcases)
<br><br>
<input type="radio" VALUE="c3"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>People Carrier</b> (1-6 Passengers - 5 Suitcases)
<br><br>
<input type="radio" VALUE="c4"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Executive</b> (1-4 Passengers - 3 Suitcases)
<br><br>
</form>

come on the gunners!
 
on this line..


var RadioButtonValue = document.quoteform.car1.value;


come on the gunners!
 
try this:


Code:
function GetPrice() {

			var RadioButtonValue = null;
			for (counter = 0; counter < quoteform.car1.length; counter++) {
			if (quoteform.car1[counter].checked)
				RadioButtonValue = quoteform.car1[counter].value;
			}
		
			if (RadioButtonValue!="") {

			xmlHttp = createRequestObject();
			var url="price.asp?PASSMYVALUE=" + RadioButtonValue;
			xmlHttp.open('GET', url, true);
			xmlHttp.onreadystatechange = GetPriceComplete;
			xmlHttp.send('');
			
		  } else {
			alert('No option was checked.');
		  }
}

Army : Combat Engineer : 21B

 
error on this line...

for (counter = 0; counter < quoteform.car1.length; counter++) {


tellin me that quoteform is not defined.. this firefox thing is pretty handy, u were rite

come on the gunners!
 
okay try this if it dont work try the second code:


Code:
function GetPrice() {

            var RadioButtonValue = null;
            for (counter = 0; counter < [highlight]document[/highlight].quoteform.car1.length; counter++) {
            if ([highlight]document.[/highlight]quoteform.car1[counter].checked)
                RadioButtonValue = quoteform.car1[counter].value;
            }
        
            if (RadioButtonValue!="") {

            xmlHttp = createRequestObject();
            var url="price.asp?PASSMYVALUE=" + RadioButtonValue;
            xmlHttp.open('GET', url, true);
            xmlHttp.onreadystatechange = GetPriceComplete;
            xmlHttp.send('');
            
          } else {
            alert('No option was checked.');
          }
}





Code:
function GetPrice() {

            var RadioButtonValue = null;
            for (counter = 0; counter < document.quoteform.car1.length; counter++) {
            if (document.quoteform.car1[counter].checked)[highlight] {[/highlight]
                RadioButtonValue = quoteform.car1[counter].value;
            }
        
            if (RadioButtonValue!="") {

            xmlHttp = createRequestObject();
            var url="price.asp?PASSMYVALUE=" + RadioButtonValue;
            xmlHttp.open('GET', url, true);
            xmlHttp.onreadystatechange = GetPriceComplete;
            xmlHttp.send('');
            
          } else {
            alert('No option was checked.');
          }
}

Army : Combat Engineer : 21B

 
Ya firebug kicks ass... it tells you everything! Another sweet exstension is its not related to web design... but speeds up web downloads... and its just sweet in general.


Hey btw how is europe? I maybe stationed there after december... im leaving for Army basic training here on aug 24

Army : Combat Engineer : 21B
 
europe is fine my friend.. gettin used to a more tropical climate, rain and sun at the same time and less seasonal climates..

u from the usa?

ok, both codes are still tellin me that

document.quoteform.car1 has no properties

on this line..
for (counter = 0; counter < document.quoteform.car1.length; counter++) {

so basically it isnt doesnt know where car1 value is..

this is the car page as it stands now..

Code:
<script type="text/javascript" src="ajax.js"></script>
<br>
[b]<form name="quoteform">[/b]
<p class="mainbody">3. Choose a <b>Vehicle</b>:<br><br>
<input type="radio" VALUE="c1"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Saloon</b> (1-4 Passengers - 3 Suitcases)
<br><br>
<input type="radio" VALUE="c2"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Estate</b> (1-4 Passengers - 4 Suitcases)
<br><br>
<input type="radio" VALUE="c3"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>People Carrier</b> (1-6 Passengers - 5 Suitcases)
<br><br>
<input type="radio" VALUE="c4"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();">&nbsp;&nbsp;<b>Executive</b> (1-4 Passengers - 3 Suitcases)
<br><br>
[b]</form>[/b]

as you can see i have added a form wrap around these details.. should i remove them??

also here is the main page again..

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]

<html>
<head>
<title> | </title>

<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="external.js"></script>
<script type="text/javascript" src="ajax.js"></script>



</head>

<body>
<div id="wrap">
		
		

<div id="bleft">
<h1 class="top">Quick Quote</h1>
[b]<form name="quoteform">[/b]
<p class="mainbody">1. Please Choose a Destination:<br><Br>
		<input type="radio" VALUE="v1" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadPostcodes();">&nbsp;&nbsp;&nbsp;<b>London Postcode</b> (N1, WC2, E14 etc..)<br><br>

		<input type="radio" VALUE="v2" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadContent2()";>&nbsp;&nbsp;&nbsp;<b>Town / Location</b> (Cambridge, Brighton etc..)<br><br>
		
		<input type="radio" VALUE="v3" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadAirports()";>&nbsp;&nbsp;&nbsp;<b>UK Airport</b> (Gatwick, Stansted etc..)<br><br>
		
		<input type="radio" VALUE="v4" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadSeaports()";>&nbsp;&nbsp;&nbsp;<b>UK Seaport</b> (Dover, Harwich etc..)<br><br>



<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="newpricehere"></td>
  </tr>
</table>
</div>


<div id="bright">
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="thecellid"></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="carcontentid"></td>
  </tr>
    <tr>
    <td id="buttonid"></td>
  </tr>
</table>
[b]</form>[/b]

</div>


			
</div>
</body>
</html>

also you can see i have given this form a name aswell.. could the fact that i have two forms named 'quoteform' be causing the problem..

you can also see that the form starts in bleft div.. and ends in bright div.. could this be the problem??

this is the ajax.js file aswell rite now.. using the 2nd piece of code u gave me.. the first one gave the same error, the 2nd code asked me to place a final '}' at the end of the page.. so i did.. here it is..

Code:
function createRequestObject() {
    var ro;
    /*@cc_on
    @if (@_jscript_version >= 5)
        try {
            ro = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                ro = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                ro = false;
            }
        }
    @else
        ro = false;
    @end @*/
    if (!ro && typeof XMLHttpRequest != 'undefined') {
        try {
            ro = new XMLHttpRequest();
        } catch (e) {
            ro = false;
        }
    }
    return ro;
}


var xmlHttp = null;
function LoadPostcodes() {
        xmlHttp = createRequestObject();
        var url="quote1.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}


var xmlHttp = null;
function LoadContent2() {
        xmlHttp = createRequestObject();
        var url="quote2.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}

var xmlHttp = null;
function LoadAirports() {
        xmlHttp = createRequestObject();
        var url="quote3.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}


var xmlHttp = null;
function LoadSeaports() {
        xmlHttp = createRequestObject();
        var url="quote4.asp"
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadContentComplete;
        xmlHttp.send('');
}


function LoadContentComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('thecellid').innerHTML = xmlHttp.responseText;
   }
}


function LoadCarContent() {
        xmlHttp = createRequestObject();
        var url="cars.asp";
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadCarContentComplete;
        xmlHttp.send('');
}


function LoadCarContentComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('carcontentid').innerHTML = xmlHttp.responseText;
   }
}


function LoadButton() {
        xmlHttp = createRequestObject();
        var url="button.asp";
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = LoadButtonComplete;
        xmlHttp.send('');
}


function LoadButtonComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('buttonid').innerHTML = xmlHttp.responseText;
   }
}



function GetPrice() {

            var RadioButtonValue = null;
            for (counter = 0; counter < document.quoteform.car1.length; counter++) {
            if (document.quoteform.car1[counter].checked) {
                RadioButtonValue = quoteform.car1[counter].value;
            }
        
            if (RadioButtonValue!="") {

            xmlHttp = createRequestObject();
            var url="price.asp?PASSMYVALUE=" + RadioButtonValue;
            xmlHttp.open('GET', url, true);
            xmlHttp.onreadystatechange = GetPriceComplete;
            xmlHttp.send('');
            
          } else {
            alert('No option was checked.');
          }
}


function GetPriceComplete() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
      document.getElementById('newpricehere').innerHTML = xmlHttp.responseText;
   }
}
}

come on the gunners!
 
Ya you can't have a form inside a form... that is probably the problem... all you need 1 form on the main page around everything...

Army : Combat Engineer : 21B

 
ok, i have taken away the extra form tag from the car section.. the main page now has the only form tag.. the elements are just on their own..

still gettin this error tho

document.quoteform.car1 has no properties

come on the gunners!
 
I hate radio buttons.. and it doesn't help that i am no where near a javascript expert... try posting your question here:

forum216

If you have ASP questions let me know... but i just got decent with javascript about a month ago... i'm still bad with radios tho...

Army : Combat Engineer : 21B

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top