Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery Mobile - Display An HTML Form Inline

Goal: Display textbox and submit button on the same line in Jquery Mobile.

Problem: They will not display on the same line.

I've tried many times to display the textbox and submit button on the same line, but it never works. Here is my code and the combinations I used...

<form method="GET" style="display: inline-block;">
     <input type="text" name="id" value="Other">
     <input type="submit" data-type="button" data-icon="plus" value="Add">
</form>

That did not work.

<form method="GET">
   <span>
     <input type="text" name="id" value="Other">
     <input type="submit" data-type="button" data-icon="plus" value="Add">
   </span>
</form>

Neither did this.

<form method="GET">
      <ul style="display: inline; list-style-type: none;">
          <li style="display: inline;"><input type="text" name="id" value="Other"></li>
          <li style="display: inline;"><input type="submit" data-type="button" value="Add"></li>
       </ul>
</form>

What am I doing wrong and how can I achieve my goal?

Thanks and merry Christmas!

like image 900
Nick Chubb Avatar asked Dec 22 '11 15:12

Nick Chubb


1 Answers

Would a Grid Layout work?

  • http://jquerymobile.com/demos/1.0/docs/content/content-grids.html

HTML:

<fieldset class="ui-grid-a">
    <div class="ui-block-a">
            <input type="text" name="id" value="Other">
    </div>
    <div class="ui-block-b">
            <input type="submit" data-type="button" data-icon="plus" value="Add">
    </div>
</fieldset>
like image 123
Phill Pafford Avatar answered Oct 05 '22 16:10

Phill Pafford