Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You could (and should) use label tag for form field label:</p> <pre><code>echo '&lt;label class="someClass"&gt;Surname: &lt;input type="text" name="surname" value="'.$row['surname']. "\" disabled /&gt;&lt;/label&gt;"; echo '&lt;label class="someClass"&gt;Forename: &lt;input type="text" name="surname" value="'.$row['forename']. "\" disabled /&gt;&lt;/label&gt;"; </code></pre> <p>Class is optional.</p> <p>Alternative syntax would be:</p> <pre><code>echo '&lt;label for="surname" class="someClass"&gt;Surname: &lt;/label&gt; &lt;input type="text" name="surname" value="'.$row['surname']. "\" disabled /&gt;"; </code></pre> <p>The you can use css to apply styles so you don't need <code>&lt;br /&gt;</code> tags:</p> <pre><code>form label{ display: block; margin: 3px 3px 2px 3px; font-size:1.1em; } //if you want to group different labels visually you can do it with classes .someClass{ color:#CCC; } </code></pre> <p>The not so correct way of doing almost the same thing would be:</p> <pre><code>echo 'Surname: &lt;input type="text" name="surname" value="'.$row['surname']. "\" disabled /&gt;&lt;br /&gt;"; echo 'Forename: &lt;input type="text" name="surname" value="'.$row['forename']. "\" disabled /&gt;&lt;br /&gt;"; </code></pre> <p>But then you lose the possibility to apply different styles easily by css and lose the trust of visually impaired users...</p> <p>Worth checking migh also be PHP function <a href="http://php.net/manual/en/function.nl2br.php" rel="nofollow">nl2br</a>.</p>
 

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