Advertisement
Guest User

Untitled

a guest
May 4th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. $('#apptForm').on 'submit', ->
  2. appt_type = $('#appointment_type').val()
  3. msg = ""
  4.  
  5. if $('#selected_product_ids:visible').length == 1 && $('#selected_product_ids input[type=checkbox]:checked').length == 0
  6. msg += "\nYou must select at least one product."
  7.  
  8. if "inspection" == appt_type && $('.measurement:visible').length > 0 && ($('.measurement').filter -> return $(this).val() * 1 > 0).length == 0
  9. msg += "\nYou must enter measurements for at least one product."
  10.  
  11. if msg.length > 0
  12. swal(msg)
  13. return false
  14.  
  15. return true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement