JQuery value submit with form

Hello,

I have the below code and I need to have it so that the information is submitted with the form.

min = dollars0

max = dollars1


<div id="slider-range"></div>
		<span id="price"></span>
	

		<script type="text/javascript">
			$("#slider-range").slider({
				range: true,
				min: 500,
				max: 4000000,
				values: [350000, 500000],
				slide: slidePrice
			});
			function slidePrice(event, ui){
				var dollars0 = parseInt($("#slider-range").slider("values", 0));
				var dollars1 = parseInt($("#slider-range").slider("values", 1));
				$("#price").text('Search in the price range from $' + getPrice(dollars0) + ' to $' + getPrice(dollars1));
			}
			function getPrice(dollars) {
				var price = null;
				return dollars;
			}
			slidePrice();
		</script>

Open in new window

LVL 1
movieprodwAsked:
Who is Participating?
 
Mark_FreeSoftwareConnect With a Mentor Commented:
add this to your form:
<input type="hidden" name="dollars0">
<input type="hidden" name="dollars1">

then in the slideprice event, add this code:
$("input[name=dollars0]").val( dollars0 );
$("input[name=dollars1]").val( dollars1 );


0
All Courses

From novice to tech pro — start learning today.