Jump to content

Add min number of characters in string help


xriokax

Recommended Posts

Hello

 

I have the following code that validates my form prior to saving...among other things, it checks to make sure the field "claim_num" is not blank. How can I change this code so I can verify if the field "claim_num" has a minimum of 7 characters?

 

Thanks Paul

 

            if ($('#claim_num').val() == "" || 
                $('#loss_date2').val() == "" || 
                $('#ucr').val() == "" || 
                $('#loss_type2').val() == 0 || 
                $('#causecode2').val() == 0 ||
                $("#claim_status2").val() == "")
            {
                $('#err_msg').hide('slow').show('slow');
            }
            else
            {
                $('#err_msg').hide('slow');
                $('#event_type').val('save');
                $('#claim_add_frm').submit();
            }
        }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.