xriokax Posted September 30, 2010 Share Posted September 30, 2010 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(); } } Quote Link to comment Share on other sites More sharing options...
Adam Posted October 1, 2010 Share Posted October 1, 2010 Using the .length property: if ($('#claim_num').length >= 7 || Quote Link to comment Share on other sites More sharing options...
xriokax Posted October 1, 2010 Author Share Posted October 1, 2010 Ahhh excellent thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.