I\'m new to jquery, but I\'m trying to use it to create a multi-step tabbed form.
One one of the pages, I have radio buttons that will show several fields depending on t
Cookies are your friends.
http://www.quirksmode.org/js/cookies.html
--or, with a jQuery plugin--
http://plugins.jquery.com/cookie
Or, localStorage is your friend!
$(document).ready(function() {
//...stuff
if (localStorage['payment']) {
if (localStorage['payment'] === 'credit')
$("#divcheque").hide();
else
$("#divcredit").hide();
}
else {
$("#divcheque").hide();
$("#divcredit").hide();
}
$("input[name='paymentmethod']").change(function() {
if( $("input[name='paymentmethod']:checked").val() == "cheque")
{
$("#divcredit").hide();
$("#divcheque").show();
localStorage['payment'] = 'cheque';
}
else if($("input[name='paymentmethod']:checked").val()== "creditcard")
{
$("#divcredit").show();
$("#divcheque").hide();
localStorage['payment'] = 'credit';
}
});
http://diveintohtml5.ep.io/storage.html
For cross-browser compatibility, use cookies. But in both ways, it would work even after your users have left for some time; something you might or might not want.