问题描述:

Currently, I am using the jQuery slider with range. What I want to do is, upon the user submitting the form, I want the two values (max and min) to also be sent over to the controller, so I can save them in the database. They are both currently saved in the variable values:

 $(function() {

$( "#slider-range" ).slider({

range: true,

min: 0,

max: 1000000,

step: 10000,

values: [100000 , 300000 ],

slide: function( event, ui ) {

$( "#amount" ).val( "£" + ui.values[ 0 ] + " - £" + ui.values[ 1 ] );

},

stop: function(event, ui) {

var values = $( "#slider-range" ).slider( "values" );

}

});

$( "#amount" ).val( "£" + $( "#slider-range" ).slider( "values", 0 ) +

" - £" + $( "#slider-range" ).slider( "values", 1 ) );

});

I have alerted the variable and it echos the correct two variables. I am at a complete loss as to how to get the two variables, possibly split, over to my Laravel controller, once the user submits the form.

I usually get the form's variables through the Input::get method:

$id = Input::get('id');

But trying to access this variable always returns NULL

Any help would be hugely appreciated.

网友答案:

Here is a jsfiddle of how to get it working properly. My guess is that you forgot to set the "name" attribute on the HTML input field.

相关阅读:
Top