View Single Post
  #1 (permalink)  
Old Aug 16th, 2006, 17:00
antonyx antonyx is offline
Junior Member
Join Date: Dec 2005
Age: 25
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Form Element has no properties when querying

if you look at the page below and do the following..
1.Click London Postcode
2.Choose Any Postcode
3.Choose Any Car
4.Click Get Quote

http://www.londonheathrowcars.com/ajax/blankquote.asp

what should happen is a 'price.asp' page should load on the left hand side of the page.. query my database and display the results..

nothings is happening tho.. i am not a javascript whiz and when i look at the code i do not fully understand what is happening..

i have installed a firefox plugin that shows javascript errors, i am also using AJAX to load my form components.

the error i receive is this..

document.quoteform.car1 has no properties

and the highlighted line in the code below seems to be where the problem is. does anyone have any ideas why this is happening because i have tested the actual query and the results should work.

there seems however to be a problem with the page recognising which car radio button has been selected.

can anyone help?

My Javascript is below.. the italic functions are the ones concerning this part of the form and as mentioned the bold line is where the error is.. apparently

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 = 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;
   }
}
}
Reply With Quote