Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    return a value to list/menu box

    Hi...i'm in the progress on writing javascript with Ajax design. I would like to return a value from data (MS Access) to the "country" selection box below are my javascript function:-

    function stateChanged(frm)
    {
    if (xmlHttp.readyState==4)
    {
    var xmlDoc=xmlHttp.responseXML.documentElement;
    if (xmlDoc.getElementsByTagName("pro_buyer")[0].childNodes[0].nodeValue!="")
    {
    document.form.pro_buyer.value =xmlDoc.getElementsByTagName("pro_buyer")[0].childNodes[0].nodeValue;
    document.form.country.value =xmlDoc.getElementsByTagName("pro_country")[0].childNodes[0].nodeValue;

    }
    }
    }

    appreciate that someone can help on this. I should code ( document.form.country??????? =xmlDoc.getElementsByTagName("pro_country")[0].childNodes[0].nodeValue

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    223
    Thanks
    0
    Thanked 14 Times in 14 Posts
    You will find some very useful information on the Quirksmode site, inparticular his section on Dynamic Options. Unfortunately his example isn't woring at the moment, but this is due to a him referencing the wrong form (I think he must have recently added a search form above the example so the example form is no longer forms[0]).

    Hope this helps.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •