|
-
Save DropDown selection with HTML5 storage?
hey everyone,
I have;
<form method="post" action="search.php">
<select name="country" class="dropdownselect" >
<option value="">Select Country</option>
<option value="Afghanistan" selected="selected">Afghanistan</option>
<option value="Albania" selected="selected">Albania</option>
<option value="Algeria" selected="selected">Algeria</option>
<option value="American Samoa" selected="selected">American Samoa</option>
</select>
</form>
And then Im doing SQL query to display results from database.
I need to somehow leave selected option selected after someones preform search and pages refresh.
Im planing to use HTML5 storage, something like this;
<script>
localStorage.setItem('country', $('select[name=country]').val());
localStorage.getItem('country');
</script>
But I dont know how to display it correctly,
Can someone help?
Thanks in advance!
Josip
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks