By ofridagan on
Hello,
I'm learning about the Form API in Drupal 7 and was wondering what is the best way to achieve the following:
I want a JQuery "slider" (jquery UI plugin) to be an input to a drupal form.
What is the best way?
a. Submit the form through jquery using the jquery form plugin - http://jquery.malsup.com/form/
then, somehow pass on the slider value to drupal.
b. Create a new form element type which will be a slider - is this possible?
Is there another way?
The submitting doesn't have to be AJAXed... it just needs to take the value from the jquery slider..
Thanks!
Comments
Actually (c), create a new
Actually (c), create a new widget that is associated with the new form elements you want it to work with. You might look at Autocomplete Widgets for an example of how to add a widget to an existing field type and the Search API ranges module might be useful for how to use the jQuery slider.
Thank you!
Thanks a lot!
I will look at those right now!
I see..
So the way that Search API ranges does this is kind of how I wanted to:
The JQuery submits the form, after changing some text fields (hidden). That's great!
I think this all what that I need. Thank!