Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
Semantic UI Dropdown with required attribute is not being marked

I have a form in Semantic UI (no react) with a select / dropdown that is required. But when users trying to send the form without having selecting something from the dropdown, the form is not showing an error message and the submit button is not working.

Like for other fields I would love to have an error message or at least mark the field red.

     <script>
        $(document).ready(function(){
            $('select.dropdown').dropdown();

            $('.ui.form').form({
                fields: {
                  timeframe: {
                    identifier: 'timeframe',
                    rules: [
                      {
                        type   : 'empty',
                        prompt : 'Please select a timeframe'
                      }
                    ]
                  },
                }
            });

        });

    </script>
    <script src="/static/semantic/components/transition.js"></script>
    <script src="/static/semantic/components/dropdown.js"></script>



    <form method="POST" enctype="multipart/form-data" class="ui form">

        <input type="hidden" name="csrfmiddlewaretoken" value="XXXX">


        <div class="ui two column grid">

            <div class="row">
                <div class="ten wide column">What's the timeframe?</div>
                <div class="six wide column">
                        <select name="timeframe" class="ui dropdown" placeholder="What's the timeframe?" required id="id_timeframe">
  <option value="" selected>---------</option>

  <option value="1">last month</option>

  <option value="2">last quarter</option>

  <option value="3">unknown</option>

</select>
                </div>
            </div>

...


    <div class="ui error message"></div>
...

</form>

On the console I see the following error:

[Error] An invalid form control with name='timeframe' is not focusable.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda