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 8540673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:39:14+00:00 2026-06-11T11:39:14+00:00

How can I add a text box beside the label for checkbox using jquery

  • 0

How can I add a text box beside the label for checkbox using jquery mobile? It should be in one line (checkbox –> label (for checkbox) –> textbox)

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

    If you want to add a label in the same line as its referencing element, like for example:

    My legend [ ] Checkbox label

    you may want to try using field containers, with data-role="fieldcontain".

    For example:

    <div data-role="fieldcontain">
        <fieldset data-role="controlgroup">
            <legend>Agree to the terms:</legend>
            <input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" />
            <label for="checkbox-2">I agree</label>
        </fieldset>
    </div>
    

    The code above will give you:

    Agree to the terms: [] I agree

    Check the online doc for more information: http://jquerymobile.com/demos/1.1.1/docs/forms/checkboxes/


    Now, if you want to several elements on one line (= several elements in different columns), I mean more than just a label and its element, you may wanna check the jQuery Mobile’s Layout grids: http://jquerymobile.com/demos/1.1.1/docs/content/content-grids.html


    Considering your example case, I think you may want to try to use a combination of the 2 methods above. So, you may try something like this:

    <div class="ui-grid-a">
    
        <!-- FIRST COLUMN -->
        <div class="ui-block-a">
            <div data-role="fieldcontain">
                <fieldset data-role="controlgroup">
                    <legend>Agree to the terms:</legend>
                    <input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" />
                    <label for="checkbox-2">I agree</label>
                </fieldset>
            </div>
        </div>
    
        <!-- SECOND COLUMN -->
        <div class="ui-block-b">
            <input type="text"/>
        </div>
    
    </div>
    

    Hope this helps.

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

Sidebar

Related Questions

I have a form where users can add input fields with jQuery. <input type="text"
How can I add &#xD; as text when using libxslt? Or, alternatively, make all
You can add as many text boxes as you want as shown by using
I have a text box on report with too long sentence Can I add
In my page there is one textbox by default and one add button beside
How i can add the multiple values from a datagrid to textbox in C#?
can I add BehaviorID attribute for asp.net textbox and use it to be recognize
I am trying to build a form where users can add a text field
I have a problem with WPF Toolkit Chart Control. I can't add text values
If I have an empty tag: <tag/> How can I add text so that

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.