Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#apptForm').on 'submit', ->
- appt_type = $('#appointment_type').val()
- msg = ""
- if $('#selected_product_ids:visible').length == 1 && $('#selected_product_ids input[type=checkbox]:checked').length == 0
- msg += "\nYou must select at least one product."
- if "inspection" == appt_type && $('.measurement:visible').length > 0 && ($('.measurement').filter -> return $(this).val() * 1 > 0).length == 0
- msg += "\nYou must enter measurements for at least one product."
- if msg.length > 0
- swal(msg)
- return false
- return true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement