SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2009
    0 Post(s)
    0 Thread(s)

    Javascript select box clear when I press back button in browser


    I have 2 select boxes on my web page - 1 for country and one for prov/state as below:
    and I have attached my js file.

    It works fine except when I go to the next page and then press the back button, the prov/state select box
    is empty - the country select retains the value selected.

    How do I fix this?

    <select id="txtCountry" type="text" name="country" onchange="GetStateProv();">
    <option value=""></option>
    <option value="Canada">Canada</option>
    <option value="United States">United States</option>
    <option value="United Kingdom">United Kingdom</option>

    &nbsp;&nbsp;<span style="margin-top:3px;">State/Prov/span>&nbsp;
    <select id="txtStateProv" type="text" name="state-prov">
    Attached Files Attached Files


Posting Permissions

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