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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:59:47+00:00 2026-05-23T12:59:47+00:00

Is there anyway to add a select box inside the header? I have tested

  • 0

Is there anyway to add a select box inside the header?

I have tested with this code

<div data-role="header" data-position="inline" data-theme="b">
    <h1>My Page</h1>
    <select>
        <option>Option 1</option>
        <option>option 2</option>
    </select>
 </div>

but it doesn’t work

Edit:

sorry because the question is not so clear. With the above code, i have a select box in the header, but the select box is centered (underneath the page title). Which i want is that, the select is placed on the right(just like a button inside header).

|[back] ——— Title ———– [select box]|

  • 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-05-23T12:59:48+00:00Added an answer on May 23, 2026 at 12:59 pm

    What do you see / not see exactly? I placed your code in a jQuery Mobile page, and I got a select field as expected in the page header. Here’s the code snippet I used, which checks out OK in Desktop and Mobile Safari (iPad):

    <body>
      <div data-role="page" id="somepage" data-theme="c">
        <div data-role="header" data-position="inline" data-theme="b">
          <h1>My Page</h1>
          <select>
           <option>Option 1</option>
           <option>option 2</option>
          </select>
        </div>
        <!-- rest of page -->
      </div>
    <body>
    

    EDIT
    I think the issue you run into is that h1 is a block element of course, and so is the select field once jQM has run its code. If you inspect the field once the page is rendered in a WebKit browser, you will see that jQM applies extra divs and the like, which means that the select field can’t easily reside on the same line as your header.

    According to the docs, you need to experiment with custom mark-up in the header by placing it in its own div (so jQM doesn’t try to manipulate it) and then styling it yourself. The kind of look you want to achieve is best done when building a header bar with two links it, but obviously that doesn’t apply for you because the second “button” isn’t a link, it’s a select field:

    The header plugin looks for immediate children of the header container, and automatically sets the first link in the left button slot and the second link in the right. In this example, the ‘Cancel’ button will appear in the left slot and ‘Save’ will appear in the right slot based on their sequence in the source order.

    You could try doing something like this to fudge it, but you’d need to test across the devices you’re supporting in your app (and obviously put the styles in a class, I’ve only done it this way for example purposes):

    <div data-role="header" data-position="inline" data-theme="b">
      <h1>My Page</h1>
      <div data-role="fieldcontain" style="position: absolute; top: 0; right: 0; margin: 0; padding: 0">
        <select>
          <option>Option 1</option>
          <option>option 2</option>
        </select>
      </div>
    </div>
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a OrganisationName select box in Edit/Add User Page. <s:select key=user.organisationname name=entity.organisationId list=organisationList
Is there anyway we can add the tomcat eclipse plugin to Adobe Flex Builder
I have the following query, which uses a CASE statement. Is there anyway to
is there anyway to programatically launch the Advance multi select gui with a button
Is there anyway to make this SQL query faster? It searches a .sdf database
This may seem strange... but I'm wondering if there is anyway to make a
Is there any way to add a field to a class at runtime (
Is there any way to add a SQL Server Database Diagram to source control?
Is there any way to add validation (ie SSN) to a SharePoint field and
Is there any way to add fields to a DataSet which will be serialized

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.