1

I've previously used popups with JQueryMobile 1.3 and older without problem. With the new 1.4 RC1 I'm finding my popups don't update when I select a different item.

You can see an example here with JQueryMobile 1.3 http://jsfiddle.net/vinomarky/56hQ9/

And another here using JQueryMobile 1.4RC1 - identical code, but the select box no longer updates when different options are chosen; http://jsfiddle.net/vinomarky/B9TqL/1/

Any ideas of what to try? the code is as follows;

<a href="#popupBasic16" data-rel="popup" data-role="button" data-inline="true" data-position-to="origin" id="log_or_norm">Lognormal</a>

<div data-role="popup" id="popupBasic16">
    <div data-role="fieldcontain">
        <fieldset data-role="controlgroup">
            <input type="radio" name="updown" id="updown46" value="Lognormal" checked="checked" />
            <label for="updown46">Lognormal</label>
            <input type="radio" name="updown" id="updown47" value="Normal" />
            <label for="updown47">Normal</label>
        </fieldset>
    </div>
</div>

And Javascript

$('select').selectmenu();

$('#updown46').click(function () {
    $('#log_or_norm .ui-btn-text').html('Lognormal');
    $('#popupBasic16-screen').click();
    document.select_choices.log_or_norm.value = "Lognormal";
    $('select').selectmenu('refresh');
});

$('#updown47').click(function () {
    $('#log_or_norm .ui-btn-text').html('Normal');
    $('#popupBasic16-screen').click();
    document.select_choices.log_or_norm.value = "Normal";
    $('select').selectmenu('refresh');
});

2 Answers 2

2

Two methods

 $('#log_or_norm').text('Normal');

Another

$('#log_or_norm ').empty().append('Lognormal');

Fiddle

http://jsfiddle.net/B9TqL/3/

0
2

Your Javascript has some errors as document.select_choices is not defined. If you want to update the value of your button use jQuery:

$('#log_or_norm').text("Lognormal");

It seems that in jQuery 1.4 they changed the HTML structure of the buttons, that's why your code $('#log_or_norm .ui-btn-text').html('Lognormal'); doesn't work. Check the full page of changes here.

Demo here.

1
  • Thanks Jonathan - I'd have given you the solution, but Sridhar got in first Nov 6, 2013 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.