1

I am unable to get this to work in jquerymobile I am getting null on the weightvalue variable :

JS

$("#submitWeight").on('click', function(e) {
    e.stopImmediatePropagation();
    e.preventDefault();

    submitWeight(e);
}); 

function submitWeight(e){

    var weightMonth = $("#selectMonth option:selected").text();
    var weightValue = $("#sliderWeight").slider( "option", "value");

    alert("Done");
} 

HTML

<input type="range" name="slider" id="sliderWeight" value="60" min="0" max="100" data-theme="c" >
Gajotres
  • 57,309
  • 16
  • 102
  • 130
kolexinfos
  • 1,030
  • 1
  • 21
  • 42

1 Answers1

5

Working example: http://jsfiddle.net/Gajotres/s33tX/

$(document).on('pagebeforeshow', '#index', function(){ 
    alert($("#sliderWeight").val());
});
Gajotres
  • 57,309
  • 16
  • 102
  • 130