Hello all
I am a bit of a JS noob but have been writing it recently but something is puzzling me.
I have a name field which contains 'full name' until it is clicked. I am trying to make the js form validation pick up wjether the field contains 'full name' and if so bring up an error message, however I am having a problem with anything containing a space.
Eg. the below works:
But this doesn't:Code:if(fullname == "") { inlineMsg('fullname','You must enter your full name.',2); return false; }
Is there any special syntax for dealing with a space in a string?Code:if(fullname == "full name") { inlineMsg('fullname','You must enter your full name.',2); return false; }
Thanks


Reply With Quote

Bookmarks