Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8504487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:02:46+00:00 2026-06-11T02:02:46+00:00

These two jQuery Mobile checkboxes have different styling, however I believe I am creating

  • 0

These two jQuery Mobile checkboxes have different styling, however I believe I am creating them in very similar ways. The top boxes I am appending dynamically, where as the bottom box is hardcoded. Does anybody know why this is this discrepancy in styles?

Div to hold fieldset

<fieldset id="surveyViewer" data-role="controlgroup">
  </fieldset>

Appending radio buttons

$('#surveyViewer').append('<legend>Survey Preview:</legend><input type="radio" name="options" id="1" value="1" /><label for="1">1</label><input type="radio" name="options" id="2" value="2" /><label for="2">2</label>');

This line to refresh styling:

$('#surveyViewer').trigger("create");
$("input[type='radio']").checkboxradio("refresh");

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:02:47+00:00Added an answer on June 11, 2026 at 2:02 am

    All of your CSS is not being applied when you are dynamically loading the top two.

    Add .trigger("create") on the element that gets the content added to.

    See here: jQuery Mobile does not apply styles after dynamically adding content

    UPDATE

    However, if you generate new markup client-side or load in content via
    Ajax and inject it into a page, you can trigger the create event to
    handle the auto-initialization for all the plugins contained within
    the new markup. This can be triggered on any element (even the page
    div itself), saving you the task of manually initializing each plugin
    (listview button, select, etc.).

    For example, if a block of HTML markup (say a login form) was loaded
    in through Ajax, trigger the create event to automatically transform
    all the widgets it contains (inputs and buttons in this case) into the
    enhanced versions. The code for this scenario would be:

    $( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );
    

    UPDATE #2

    // HTML
    <a id="myButton" href="" data-role="button" data-theme="e">Add Radio</a>
    
    <div id="radiodiv1">
    <fieldset id="surveyViewer" data-role="controlgroup"></fieldset>
    </div>
    
    // JS 
    $( "#myButton" ).bind( "click", function(event, ui) {
    
         $("#surveyViewer").append('<legend>Survey Preview:</legend><input type="radio" name="options" id="1" value="1" /><label for="1">1</label><input type="radio" name="options" id="2" value="2" /><label for="2">2</label>');
    
         $("#radiodiv1").trigger("create");
    
    });
    

    I created a JSfiddle to illustrate a solution. I did all this on my iPad (you’re welcome) so if this works for you, PLEASE at least mark it as the correct answer lol. Here’s the link (based on adding the radio buttons via a button click)

    WORKING EXAMPLE: http://jsfiddle.net/nsX2t/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Jquery mobile, and I have these two select lists, I want
I have a very standard CRUD app in Rails & Jquery Mobile with two
I have a Jquery Mobile controlgroup with two buttons: <div data-role=controlgroup data-type=horizontal class=headerMenu iconposSwitcher>
I have two pages, p1.html and p2.html with jQuery Mobile. There is some links
I am using jquery mobile. I have created a very simple page where there
I've posted similar question but no response. I have a jQuery Mobile site and
I'm developing a JQuery Mobile application which loads from two different domains. (some pages
I have these two lines: $target_box.children('a.ajax_trigger_title').addClass('opened_post_title'); jQuery('#'+$target_box.attr('id')+' a.ajax_trigger_title').addClass('opened_post_title'); The first line doesn't work, but
Suppose I have two pages: - page 1 uses jquery mobile and has a
Starting Situation These two commands should be equivalent. jQuery('a').filter(':contains(about)'); and jQuery.find('a').filter(':contains(about)'); Problem In fact,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.