Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a <a href="http://jsfiddle.net/ZDgP5/" rel="nofollow">working version of your code on fiddle</a>.</p> <h3>What was causing the problem:</h3> <p>When using Bootstrap horizontal forms always remember that the structure should be as follows:</p> <pre><code>&lt;form class="form-horizontal"&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="inputEmail"&gt;Email&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" id="inputEmail" placeholder="Email"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>So in your case you should nest the "sub-settings" in a <strong>single</strong> <code>div class="controls"</code>: the one after the <code>"TopSettings="</code> label block. This is logical as all of the "sub-settings" form <strong>one nested block</strong> that is the control corresponding to the label <code>"TopSettings="</code>. </p> <p>Then, there is no need to use <code>form-inline</code>: notice that the nested block (the "sub-settings" group) is nothing else than another nested instance of <code>form-horizontal</code>. Since the properties of <code>form-horizontal</code> are already inherited from the parent form, there is no need to repeat oneself. Instead, you should wrap <strong>each of the three</strong> "sub-settings" in a <code>control-group</code> div which in its turn will contain the label and the control.</p> <p>Here is the revised code:</p> <pre><code>&lt;div class="control-group code"&gt; &lt;label class="control-label code"&gt;TopSettings=&lt;/label&gt; &lt;div class="controls"&gt; &lt;div class="control-group code"&gt; &lt;label class="control-label"&gt;Enabled= &lt;/label&gt; &lt;div class="controls"&gt; &lt;input class="code" type="radio" name="Enabled" value="Y"/&gt;y &lt;input class="code" type="radio" name="Enabled" value="N"/&gt;n &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group code"&gt; &lt;label class="control-label"&gt;textbox1=&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="number" name="textbox1e" onblur="if(this.value=='') this.value = 40" placeholder=40 /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="control-group code"&gt; &lt;label class="control-label"&gt;textbox2=&lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="number" name="textbox2" placeholder=640 /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <h2>EDIT</h2> <p>To align the sub-controls you can add the following custom two classes to your css:</p> <pre><code>.form-horizontal .control-label.subcontrol-label{ width: auto; } .form-horizontal .controls.subcontrols{ margin-left: 80px; } </code></pre> <p>and use them accordingly with the sub-settings labels e.g. </p> <p><code>&lt;label class="control-label subcontrol-label"&gt;</code></p> <p>and controls div e.g. </p> <p><code>&lt;div class="controls subcontrols"&gt;</code>.</p> <p>You can find the updated version of the demo <a href="http://jsfiddle.net/ZDgP5/4/" rel="nofollow">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload