Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!