Ok... I rephrased my question, hopefully you can understand what I am getting at now.
I am using a JQuery Slider function in one of my forms that has the following code:
<script>
$(function() {
$( "#slider" ).slider({
value: 0,
min: 0,
max: 100,
step: 1,
slide: function( event, ui ) {
$( "#amount" ).val( ui.value + "% Clear" );
}
});
$( "#amount" ).val( $( "#slider" ).slider( "value" ) + "% Clear" );
});
</script>
And the form looks like:
<form method=POST etc...>
<div id="slider"></div>
<span><input type="text" id="amount" name="Percentage" style="border:0; color:#f6931f; font-weight:bold;" /></span>
</form>
In the php, I have an error system set up, so that after the form POSTs, if there is an error in the form (for example one of the form inputs is left blank etc.), an error will generate and the page will refresh with an error message telling the user to correct the form and re-submit.
However, the slider always reverts back to 0 after the page refresh... How can I change this so that the slider keeps the same value that the user set it at before the POST. Is this possible, I am having trouble figuring it out. Thanks!