Moonsoft Software Solutions

How to creat a Java sliders function

Started 1 Sep 2013 · 1 reply

  1. moon_1218
    Im trying to make a calculator like

    http://www.speakingofcode.com/demos/developer/price_estimator/index.htm


    if there a sample already made so i can see the basic code for the sliders and take example.

    I think many can use suck a function.
  2. Moonsoft support
    Hello,
    you can use basic sliders from jquery. Create fields as option lists with all your values, insert them at the layout, and use the javascript tab to build sliders based on each option list. For ex: an option list named 'myoptions', with 5 options, will require the following code at js tab:

    var select = CB( "#myoptions" );
    var slider = CB( "" ).insertAfter( select ).slider({
    min: 1,
    max: 5,
    range: "min",
    value: select.selectedIndex + 1,
    slide: function( event, ui ) {
    select.selectedIndex = ui.value - 1;
    }
    });
    //Hide the original input option if needed
    CB( "#myoptions" ).hide();

    You'd need to change the name of the field, and the range of numeric values accepted.


    Here the full official information page:

    http://jqueryui.com/slider/#hotelrooms


    All widgets here can be included, replacing the $ sign for the calcbuilder jquery instance 'CB'

    Hope this helps, regards

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket