Got it working, thanks.
So on this form I have a back-up PHP validation script to double check, in case JS is turned off. If one of the fields fails, it passes all of the values you typed into the form back to the fields, with an error message, so you don't have to type them all in again. That works okay with form elements but how do I set the value of this menu back to the country they selected? I am assuming I need to use jQuery to set it. Line 5 where it says "Please Select Your Country" I need to insert the country they selected there, so they don't have to select it again because their email broke the preg_match()....
The country value is being passed back as $_SESSION['tmpCountry'];
- <div class="form-row">
- <dl id="countrieslist" class="dropdownC">
- <p>Country</p>
- <dt><a>
- <span>Please Select Your Country</span>
- </a></dt>
- <dd>
- <ul>
- <li class="dark"><img class="flag text-middle" src="images/flags/unitedstates.png" alt="" />
- <a>United States<span class="value">United States</span></a></li>
- <li class="dark"><img class="flag text-middle" src="images/flags/canada.png" alt="" />
- <a>Canada<span class="value">Canada</span></a></li>
- <li class="dark"><img class="flag text-middle" src="images/flags/mexico.png" alt="" />
- <a>Mexico<span class="value">Mexico</span></a></li>';