Passing a php variable to javascript and javascript if statements
<p>I have a form that submits on itself with edit, delete add parts.</p>

<p>I used a jquery slider to set salary range (It's a job board).</p>

<p>The slider sets SalaryR (the range out put for the screen), SalaryMin and SalaryMax to hidden fields for saving to db.</p>

<p>What I would like to do is have the range set as the already stored amounts if SalaryMin,Max are already set so that I can edit the form. At the moment it defaults back to 20000,50000.</p>

<p>I have no knowledge of Javascript and was surprised I managed to get the min/max values out in the first place. Here is the slider code:</p>

<pre><code>$( "#slider-range" ).slider({
        range: true,
        min: 8000,
        max: 100000,
        step: 500,
        values: [ 20000, 25000 ],
        slide: function( event, ui ) {
            $( "#SalaryR" ).val( "£" + ui.values[ 0 ] + " - £" + ui.values[ 1 ] );
            $( "#SalaryMin" ).val( ui.values[ 0 ] );
            $( "#SalaryMax" ).val( ui.values[ 1 ] );
        }
    });
    $( "#SalaryR" ).val( "£" + $( "#slider-range" ).slider( "values", 0 ) +
        " - £" + $( "#slider-range" ).slider( "values", 1 ) );
</code></pre>
