Hello thanks for reading my question. Here is what I have
This java script

My php script calls several select lists for country, state, city, zipcode.
Php Script Part

$Var = <select name='Country' onchange=\"reload1(this.form)\">

Java Part

function reload1(form)
{
    var val=form.Country.options[form.Country.options.selectedIndex].value;
    self.location='geo_locations.php?CID=' + val ;
}

What I would like to do is pass the form name and file name via var like this

$Var = <select name='Country' onchange=\"reload1(this.form,Country,geo_locations.php)\">

Java Part

function reload1(form,fname,file)
{
    var val=form.fname.options[form.fname.options.selectedIndex].value;
    self.location=file'?CID=' + val ;
}

I tried to do this step by step but my first step adjusting the Country part didn't work at all?
Anyway thanks for any help

    Your problem is that you misunderstand the DOM for a <select>.

    selectedIndex is a property of a SELECT object not an OPTION object. So it should be:

    form.Country.options[form.Country.selectedIndex]
      Write a Reply...