Required does not work

0

I would like the fields not to be sent in white, so I tried using the required .. but it is not working. What is the reason?

<form action="https:/----Site---" method="POST">
  <input type=hidden name="oid" value="00Dj0000001qrSu">
  <input type=hidden name="retURL" value="http://-----/?msg=ok">
  <input type=hidden name="lead_source" value="Formulário Site">
  <table>
    <tr>
      <td>
        <input type="text" name="first_name" placeholder="Nome:" maxlength="250" required="required" />
      </td>
      <td>
        <input type="text" name="email" placeholder="E-mail:" maxlength="250" required="required" />
      </td>
    </tr>
    <tr>
      <td>
        <input type="text" name="company" placeholder="Empresa:" maxlength="250" required="required" />
      </td>
      <td>
        <input type="text" name="phone" placeholder="Telefone:" maxlength="250" required="required" />
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <textarea name="description" placeholder="Mensagem/Comentários:" rows="4" required="required"></textarea>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <input type="submit" name="enviar" value="Enviar" />
      </td>
    </tr>
  </table>
</form>
    
asked by anonymous 09.11.2015 / 13:03

2 answers

1

I've done the test and it's working for me. The "required" was a feature added to HTML5 your browser needs to have support for it. Take a test in chrome for example.

You can use link to find out if your browser is suitable.

<form action="https:/----Site---" method="POST">
    <input type=hidden name="oid" value="00Dj0000001qrSu">
    <input type=hidden name="retURL" value="http://-----/?msg=ok">
    <input type=hidden name="lead_source" value="Formulário Site">
    <table>
        <tr>
            <td>
                <input type="text" name="first_name" placeholder="Nome:" maxlength="250" required="required" />
            </td>
            <td>
                <input type="text" name="email" placeholder="E-mail:" maxlength="250" required="required"/>
            </td>
        </tr>
        <tr>
            <td>
                <input type="text" name="company" placeholder="Empresa:" maxlength="250" required="required" />
            </td>
            <td>
                <input type="text" name="phone" placeholder="Telefone:" maxlength="250" required="required" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <textarea name="description" placeholder="Mensagem/Comentários:" rows="4" required="required"></textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" name="enviar" value="Enviar" />
            </td>
        </tr>
    </table>
</form>
    
09.11.2015 / 13:15
0

The REQUIRED attribute was inserted with HTML5 and only works on some versions of browsers.

Possibly you are testing in a browser that does not support, it follows the list of browsers that accept and validate the REQUIRED attribute

link

    
09.11.2015 / 13:21