jQuery validate single input and require two strings First and Last name -
i use registration form asks users enter full name 1 input field. php class parses first , last name , inserts our db. found out our billing system doesn't receiving first name have validate form field , make sure there 2 strings entered. fiddle of basic input validation i'm not , writing rule check 2 strings. appreciated
thanks
you try with:
$(document).ready(function() { $("#btn").click(function(e) { if (/\w+\s+\w+/.test($("#cname").val())) { alert("good"); } else { alert("bad"); } e.preventdefault(); }); });
fiddle: http://jsfiddle.net/yrffg/
Comments
Post a Comment