GenesisTech
asked on
Set selected value in Drop Down
I have inherited a classic asp website and I am having some trouble with 1 particular section of it.
There is a drop down list with 3 shipping options in it. The 1st item in the list is "Please Select". This 1st option is set as "selected".
When the use enters their Zip Code, it runs a prototype ajax updater routine that reloads the shipping options in the drop down.
After it loads the options, it is selecting the last option in the list instead of the 1st option of "Please Select".
When you look at the html code, it sill shows that the 1st option is "selected". So, I assume that the last option is being selected via javascript as part of the ajax routine and exists in RAM instead of written html.
How in the world do I troubleshoot this and where do I look to see how the selected item is being selected?
Any guidance is appreciated!
There is a drop down list with 3 shipping options in it. The 1st item in the list is "Please Select". This 1st option is set as "selected".
When the use enters their Zip Code, it runs a prototype ajax updater routine that reloads the shipping options in the drop down.
After it loads the options, it is selecting the last option in the list instead of the 1st option of "Please Select".
When you look at the html code, it sill shows that the 1st option is "selected". So, I assume that the last option is being selected via javascript as part of the ajax routine and exists in RAM instead of written html.
How in the world do I troubleshoot this and where do I look to see how the selected item is being selected?
Any guidance is appreciated!
post the code or BETTER a link to your page
ASKER
Leakim- What code are you interested in seeing? The ajax call?
ASKER
function updateshipzipcodecountryaj ax(form) {
document.getElementById("s elresultli st").inner HTML="<img src='images/ajaxshippinglo ad.gif' border='0'> checking availability...";
document.getElementById('A ction').di sabled = true;
var checkingurl="dnswajaxshipp ingzipcode country.as p";
var pars = 'zipcode=' + form.shipzip.value + '&country=' + form.shipcountry.value +'';
var url = checkingurl + '?' + pars;
var target = 'selresultlist';
var myAjax = new Ajax.Updater(target, checkingurl, {method: 'post',parameters: pars});
document.getElementById('A ction').di sabled = false;
}
document.getElementById("s
document.getElementById('A
var checkingurl="dnswajaxshipp
var pars = 'zipcode=' + form.shipzip.value + '&country=' + form.shipcountry.value +'';
var url = checkingurl + '?' + pars;
var target = 'selresultlist';
var myAjax = new Ajax.Updater(target, checkingurl, {method: 'post',parameters: pars});
document.getElementById('A
}
ASKER
The resulting page looks like this but the last Option winds up being selected.
<div name='selresultlist' id="selresultlist">
<select size=1 name="shipmethodType" onchange="shippingCheck(th is)">
<option value="" selected>Select</option>
<option value="U.S. Standard (Typically 2-3 Days) [$7.90]">U.S. Standard (Typically 2-3 Days) [$7.90</option>
<option value="U.S. Expedited (Typically Next Day) [$25.00]">U.S. Expedited (Typically Next Day) [$25.00</option>
<option value="Pick Up [$0.00]">Pick Up [$0.00]</option>
</select>
</div>
<div name='selresultlist' id="selresultlist">
<select size=1 name="shipmethodType" onchange="shippingCheck(th
<option value="" selected>Select</option>
<option value="U.S. Standard (Typically 2-3 Days) [$7.90]">U.S. Standard (Typically 2-3 Days) [$7.90</option>
<option value="U.S. Expedited (Typically Next Day) [$25.00]">U.S. Expedited (Typically Next Day) [$25.00</option>
<option value="Pick Up [$0.00]">Pick Up [$0.00]</option>
</select>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Please close and delete this question - I figured out the problem.
Thank you!
Thank you!