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

http://jsfiddle.net/peter/4x3mx/1/

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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -