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

126
Visualizações
Warning before saving form implement

I am working on an app where Admin can publish a welcome message to the public page. I need to have a warning message before Publishing the message, basically, after they click ‘Publish to Public page’ show a warning which says “You are about to publish this content to the world, on your public status page. It will be visible to all internet users, not just your colleagues. Click ‘OK’ to publish or ‘Cancel’ to go back.

If they click ‘Cancel’ provide a warning like ‘Are you sure you want to Cancel? Click ‘OK’ to delete your Edits’

I have the first of the warning so far:

My form

          <form accept-charset="UTF-8" id ="edit-public-page-form" class="message-form" action="<%= public_page_path %>" method="post" data-image-path="<%= upload_image_noticeboards_path %>">
            <textarea class="noticeEditor" name="content" style="width: 100%; height:340px;">
              <%= @welcome_message %>
            </textarea>
            <%= hidden_field_tag :authenticity_token, form_authenticity_token %>
            <%= hidden_field_tag :_method, "put" %>
            <br>
            <%= t('statusx.public_page_link')%>
            <%= link_to "https://demo.getvetter.com/public", target: :_blank %>
            <br>
            <br>
            <button
            id='saveButton'
            class="btn btn-primary tn-w-m"><%= t('statusx.save') %></button>
            <button id="cancel_submit" class="btn btn-default btn-w-m"><%= t('cancel') %></button>
          </form>
  $('#edit-public-page-form').submit(function(event) {
    return confirm('You are about to publish this content to the world, on your public status page. It will be visible to all internet users, not just your colleagues. Click \'OK\' to publish or \'Cancel\' to go back.');
  });

I just don't know how to implement the second part of the warning. Thanks for your help

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