i will show you absolutely everything if it will help get it fixed.. ok here is the situation..
ONE MAIN PAGE (where everything happens..) this page is called blankquote.
asp, within this page are 3 table cells (used as containers) which load different
asp pages into them when the user uses the form..
so.. i have it set up at the moment to test the London Postcode radio button.. you click that postcode radio.. and it loads 'quote1.
asp' on the rite hand site (which is a drop down with many postcodes)
you choose a postcode and it loads the car selection page 'cars.
asp' in another container immediately below it..
when you choose a car radio.. another page.. 'button.
asp' loads below
when you click the button, the database should be queried and a final 'price.
asp' page should load on the left hand side of the page displaying the results.. this is not happening tho..
here is all the code i got.
im gettin this error
document.quoteform.car1 has no properties on the bold line of the below
ajax.
js file..
ajax.
js
- Code: Select all
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 = document.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;
}
}
}
blankquote.
asp
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<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();"> <b>London Postcode</b> (N1, WC2, E14 etc..)<br><br>
<input type="radio" VALUE="v2" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadContent2()";> <b>Town / Location</b> (Cambridge, Brighton etc..)<br><br>
<input type="radio" VALUE="v3" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadAirports()";> <b>UK Airport</b> (Gatwick, Stansted etc..)<br><br>
<input type="radio" VALUE="v4" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadSeaports()";> <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>
quote1.
asp
- Code: Select all
<%
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>
cars.
asp
- Code: Select all
<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();"> <b>Saloon</b> (1-4 Passengers - 3 Suitcases)
<br><br>
<input type="radio" VALUE="c2"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();"> <b>Estate</b> (1-4 Passengers - 4 Suitcases)
<br><br>
<input type="radio" VALUE="c3"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();"> <b>People Carrier</b> (1-6 Passengers - 5 Suitcases)
<br><br>
<input type="radio" VALUE="c4"
name="car1" onMouseOver="style.cursor='pointer'" onclick="LoadButton();"> <b>Executive</b> (1-4 Passengers - 3 Suitcases)
<br><br>
button.
asp
- Code: Select all
<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>
price.
asp
- Code: Select all
<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>