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

  • Home
  • SEARCH
  • 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 8511787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:06:13+00:00 2026-06-11T04:06:13+00:00

Here is an example HTML page that demonstrates the issue: <!DOCTYPE html> <html> <head>

  • 0

Here is an example HTML page that demonstrates the issue:

    <!DOCTYPE html> 
    <html> 
            <head> 
            <title>My Page</title> 
            <meta name="viewport" content="width=device-width, initial-scale=1"> 
            <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
            <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
            <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
    </head> 
<body> 

<div data-role="page">

    <div data-role="header">
        <h1>My Title</h1>
    </div><!-- /header -->

    <div data-role="content" id="cp">   
        <form id="form">
            <div data-role="fieldcontain">
                <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                    <legend>Test 1:</legend>
                    <input type="radio" name="r1" id="r1a" value="none" checked="checked" /><label for="r1a">A</label>
                    <input type="radio" name="r1" id="r1b" value="detail"/><label for="r1b">B</label>
                    <input type="radio" name="r1" id="r1c" value="measure"/><label for="r1c">C</label>
                </fieldset>
            </div>
        </form>     
    </div><!-- /content -->

</div><!-- /page -->


<script type="text/javascript">
$(document).ready(function() {
    var form = $('#form');

    form.append('<div data-role="fieldcontain">');
    form.append('   <fieldset data-role="controlgroup" data-type="horizontal">');
    form.append('      <legend>Test 2:</legend>');
    form.append('      <input type="radio" name="r2" id="r2a" value="none" checked="checked" /><label for="r2a">A</label>');
    form.append('      <input type="radio" name="r2" id="r2b" value="detail"/><label for="r2b">B</label>');
    form.append('      <input type="radio" name="r2" id="r2c" value="measure"/><label for="r2c">C</label>');
    form.append('   </fieldset>');
    form.append('</div');

    form.trigger('create');
});
</script>


</body>
</html>

Save this page and load it in a borwser. You will see that the “Test 1” radio list comes up horizontal (as it should because of the data-type="horizontal" attribute). However the “Test 2” radio list, which is added dynamically, comes up vertically, which is the default setting. It seems the data-type="horizontal" has no effect on the dynamically created radio list.

Is there a refresh or event anyone knows about which I should trigger somewhere in the DOM to get this to work?

  • 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-11T04:06:15+00:00Added an answer on June 11, 2026 at 4:06 am

    The problem is the way you are adding your new elements to the form. If you change your javascript function to this you’ll see that it works:

    $(document).ready(function() {
        var form = $('#form');
    
        var newElement = '';
        newElement += '<div data-role="fieldcontain" data-type="horizontal">';
        newElement += '   <fieldset data-role="controlgroup" data-type="horizontal">';
        newElement += '      <legend>Test 3:</legend>';
        newElement += '      <input type="radio" name="r3" id="r3a" value="none" checked="checked" /><label for="r3a">A</label>';
        newElement += '      <input type="radio" name="r3" id="r3b" value="detail"/><label for="r3b">B</label>';
        newElement += '      <input type="radio" name="r3" id="r3c" value="measure"/><label for="r3c">C</label>';
        newElement += '   </fieldset>';
        newElement += '</div>';
    
        form.append(newElement);
    
        form.trigger('create');
    });
    

    Think about it this way: Each time the append() function is used the browser attempts to add whatever you’ve given it to the DOM. But because you have broken your elements across different calls to append() the browser has to try to make sense of it. So when you have this:

    form.append('<div data-role="fieldcontain">');
    

    The browser sees that you’ve left off a closing div tag and tries to fix it for you by adding it. This means your next call to append() will not go inside the div you just added but after it because the browser has automatically closed it for you.

    You should add complete, well-formed elements to avoid this issue.

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

Sidebar

Related Questions

Here is an example of an HTML page that consists of a header and
Checking the datagrid example here http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html see the datagrid section It says that if
Here's what I'm trying to achieve: Before: www.example.com/index.php?page=about&pg=5 After: www.example.com/about.html?pg=5 The URL must specifically
A seen in the title, here the HTML Code example: <body> <!--CODE_START--> <p>I <strong>Want</strong>
I would like to translate or 301-redirect urls such as: www.domain.com/example.html to www.domain.com/example Here
Before I explain, here's the example HTML code : [ Demo on jsFiddle here.
I am using the jQuery spinner tool found here: http://btburnett.com/spinner/example/example.html When I try using
Here is example which I have try <?php include 'spider/classes/simple_html_dom.php'; $html = new simple_html_dom();
Here is an example: $(function() { $('#test').change(function() { $('#length').html($('#test').val().length) }) }) <script src=https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js></script> <textarea
I follow example from here using section listview http://lalit3686.blogspot.com/2012/05/sectionadapter.html But how can I implement

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.