JQuery Form Validator Problem
hi, i have a code from php point of sale like this :
- $(document).ready(function()
- {
- $('#supplier_form').validate({
- submitHandler:function(form)
- {
- $(form).ajaxSubmit({
- success:function(response)
- {
- tb_remove();
- post_person_form_submit(response);
- },
- dataType:'json'
- });
- },
- errorLabelContainer: "#error_message_box",
- wrapper: "li",
- rules:
- {
- first_name: "required",
- last_name: "required",
- email: "email"
- },
- messages:
- {
- first_name: "First name is required",
- last_name: "Last name is required",
- email: "Invalid format"
- }
- });
- });
in my case, i want to validate if the first name and last name empty it will return error.
But if one of them isn't empty, it still return success state....
can you guys teach me how to make rules that suitable for condition above??
thanks