title: PHP Append <span> after <input> on form submit
body: <p>I have to build a calculator with php. When i press the submit buttom, if the value of x isn't a number i have to display a span error after the input label.</p>
  
  <pre><code>&lt;form action="" method="GET" onsubmit="return keepCombobox();"&gt;
          &lt;h1&gt;Multiplicador&lt;/h1&gt;
          &lt;!--Draws the box around the related elements--&gt;
          &lt;fieldset&gt;
              &lt;p id="x"&gt;
                  &lt;!--If the label is pressed, sends the focus to the input--&gt;
                  &lt;label for="x"&gt;X: &lt;/label&gt;
  
                  &lt;input type="text" id="x" name="x" value="&lt;?php echo html_entity_decode($x, ENT_COMPAT, "UTF-8"); ?&gt;"/&gt;
              &lt;/p&gt;
  
              &lt;p id="y"&gt;
                  &lt;!--If the label is pressed, sends the focus to the input--&gt;
                  &lt;label for="y"&gt;Y: &lt;/label&gt;
                  &lt;input type="text" id="y" name="y" value="&lt;?php echo html_entity_decode($y, ENT_COMPAT, "UTF-8"); ?&gt;"/&gt;&lt;br&gt;&lt;!--span style="color: red"&gt;valor nao valido&lt;/span--&gt;
              &lt;/p&gt;
  
              &lt;p&gt;
                  &lt;select name="op" required&gt;
                      &lt;option value=""&lt;?php if ($op == "") { ?&gt; selected&lt;?php } ?&gt;&gt;-- Operação --&lt;/option&gt;
                      &lt;option value="+"&lt;?php if ($op == "+") { ?&gt; selected&lt;?php } ?&gt;&gt;Soma&lt;/option&gt;
                      &lt;option value="-"&lt;?php if ($op == "-") { ?&gt; selected&lt;?php } ?&gt;&gt;Subtração&lt;/option&gt;
                      &lt;option value="*"&lt;?php if ($op == "*") { ?&gt; selected&lt;?php } ?&gt;&gt;Multiplicação&lt;/option&gt;
                      &lt;option value="/"&lt;?php if ($op == "/") { ?&gt; selected&lt;?php } ?&gt;&gt;Divisão&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/p&gt;
  
              &lt;p&gt;
                  &lt;!--Button--&gt;
                  &lt;input type="submit" value="Calcular"/&gt;
              &lt;/p&gt;
  
              &lt;?php
                  if ($_GET){
              ?&gt;
  
              &lt;p&gt;
                  &lt;?php
                  if (!is_numeric($x)){
                      echo "&lt;br&gt;&lt;span style=\"color: red\"&gt;valor nao valido&lt;/span&gt;";
                  } else if (!is_numeric($y)) {
                      echo "&lt;br&gt;&lt;span style=\"color: red\"&gt;valor nao valido&lt;/span&gt;";
                  } else {
                      switch($op){
                      case '+':
                          echo "O resultado é  " . ($x + $y) ;
                          break;
                      case '-':
                          echo "O resultado é  " . ($x - $y) ;
                          break;
                      case '*':
                          echo "O resultado é  " . ($x * $y) ;
                          break;
                      case '/':
                          if ($y == 0) {
                              echo "Não é possível dividir por zero";
                          }
                          else {
                              echo "O resultado é  " . ($x / $y) ;
                          }
                          break;
                      }
                  }
                  ?&gt;
              &lt;/p&gt;
              &lt;?php
                  }
              ?&gt;
          &lt;/fieldset&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I want to know how i can append the </p>
  
  <pre><code>br&gt;&lt;span style="color: red"&gt;valor nao valido&lt;/span&gt;
  </code></pre>
  
  <p>after the input where i get the value</p>