jquery - How do i check for a specific value in a field using javascript? -


the javascript checks form values not being empty

 if(!$('nradulti').value){ok=2;}  if(!$('transport').value){ok=2;}  if(!$('plata').value){ok=2;}   if(ok==1){return true;}   else if(ok==2){       $('mesaj').innerhtml="       <span class='notarea'>please complete fields.</span>";       return false;  } 

i need add new variable called spam captcha , check equal number, e.g. "what's 2+2" , script proceed if number 4

what line need add please?

thanks!

you can accomplish basic equality check. i'm not sure framework using, given other calls.

if(!$('spam').value == '4'){    ok=2; } 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -