Search This Blog

11 February 2014

How to check if at least one field is set in a form before submiting using JQuery

I have a form with many fields (Textbox, Listbox, Checkbox, Radio Button, File box, Text Area) in my PHP page. When submitting the form, I need to check at least one field must be set. If it’s not I don’t want to submit the form. The form is having lots of control, so it’s not a good idea to go through each control to check if a value is set. So here is a JavaScript function which will make the job very easy.




2 comments:

  1. good BlogSpot .... I really liked it.....great work..!!

    ReplyDelete
  2. Hello there! This blog post couldn't be written much better! Looking through this post reminds me of my previous roommate! He continually kept preaching about this. I'll send this information to him. Fairly certain he will have a good read. Thank you for sharing!

    ReplyDelete