Combo box passing value

I am developing a web page which integrates with SQL server.

I am trying to acquire a value from combo “z” and pass it to combo “z2”.

“autocomplete.php” creates xml files by data from tables.

I am not sure how to pass “thisvariable” to “z2”.

If it went well, z2 can carry fewer records according to the value selected in z1.

Do you have any suggestions?

            var z=new dhtmlXCombo("name1con","name1id",300);     


            z.loadXML("autocomplete.php?op=name1xml", true, true);     

         z.attachEvent("onChange",function(){var thisvariable = z.getComboText(); });            


            var z2=new dhtmlXCombo("name2con","name2id",300);         


            z2.loadXML("autocomplete.php?op=mame2xml", true, true);     

You can use
var thisvariable = z.getComboText();

var z2=new dhtmlXCombo(“name2con”,“name2id”,300);

as result second combo will work in autocomplete mode instead of full data loading, and each time when value in first combo selected url of second combo will be updated to contain only data about related items. If you need to have full load approach instead of autocomplete it can be done as

var thisvariable = z.getComboText();