OK so i wanted to use this in a custom module i was developing and i noticed people were having all kinds of problems getting one running so hopefully this may help said people:

First things first grab down this module, jquery_update and the jquery_ui module (forget jgp)

install jquery_update module (this will update your Drupal 6 site to jquery 1.3.2)

install jquery_ui module and plugin (I used jquery ui 1.7, extract the library to the jquery_ui module folder and rename the folder to jquery.ui......so sites/all/modules/jquery_ui/jquery.ui/ui should be your structure)

Now from this issue:

http://drupal.org/node/434448

follow post 8: http://drupal.org/node/434448#comment-3105954 exactly

Once done the general layout for formapi that worked for me was:

$form['forum-column-3'] = array(
    '#type' => 'slider_textfield',
    '#title' => t('Last Comment Column Width'),
    '#default_value' => 25,
    '#slider_settings' => array(
      'min' => 0, // ". t('The minimum value of the input field.') ."<br />";
      'max' => 100, // ". t('The minimum value of the input field.') ."<br />";
      'width' => 300, // ". t('The width of the slider in pixels.') ."<br />";
      //'start' => 'someCustomCallbackFunction' //A callback function that gets called when the user starts sliding
      //'stop' => 'someCustomCallbackFunction' //A callback function that gets called when the user stops sliding
      //'slide' => 'someCustomCallbackFunction' //A callback function that gets called on every mouse move during slide
      ),
    '#weight' => -7,
    '#description' => t('Use the slider to set the percentage'),
  );

and thats it upon for submit the values are in form state so i can do what i want with them, the only issue i now have is that this only works for one slider on the page at a time, and i need 3......this is due to the ID "slider_callout" that is looked for in the slider_textfield.js file being shared accross all sliders, anyone have a clue how to get around that.

Regards,

Mike

Comments

ressa’s picture

Thanks Mike! I will be using the module at some point in the future, so your instructions will come in handy. Did you manage to get it to work with 3 sliders on the same page?

mskull’s picture

Nope. Have now moved to Drupal 7 as well but the module this was implemented in will be coming with me so not sure how to do this implementation now as no D7 version, its not a major issue its a nice to have so im not too bothered......ah who am i kidding i want my sliders!!