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

173
Views
notify user, on image sbmission , before submit rails
  <div class="form-group">
    <label><%=  (I18n.t 'user.form.your_avatar')%></label>
    <div class="push">
        <%= image_tag @user.avatar, class: 'img-avatar' if @doctor.avatar.attached?  %>
    </div>
    <div class="custom-file">
        <%= form.file_field :avatar, class: 'custom-file-input', data: { toggle: 'custom-file-input' } %>
        <%= form.label :avatar, I18n.t('doctor.form.choose_new_avatar'), class: 'custom-file-label' %>
    </div>
  </div>

I want to inform user once he chooses image image uploaded successfully , before submitting the data. How can this be handled? Any logic?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Then you just need a little jQuery script to add a notification after an image was chosen.

$(document).ready(function () {
    $(document).on('change', '.custom-file-input', function (_e) {
        alert("You've added an image!");
    });
});

about 4 years ago · Juan Pablo Isaza Report
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!