www.webdeveloper.com
Results 1 to 2 of 2

Thread: if(fullname == "full name") - This brings up an error?

  1. #1
    Join Date
    Nov 2006
    Posts
    10

    Unhappy if(fullname == "full name") - This brings up an error?

    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:
    Code:
    if(fullname == "") {
        inlineMsg('fullname','You must enter your full name.',2);
        return false;
      }
    But this doesn't:
    Code:
    if(fullname == "full name") {
        inlineMsg('fullname','You must enter your full name.',2);
        return false;
      }
    Is there any special syntax for dealing with a space in a string?

    Thanks

  2. #2
    Join Date
    Nov 2006
    Posts
    10
    Sorted

    I was calling an incorrect variable

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles