Jump to content


Photo

Simple Javascript field check


  • Please log in to reply
2 replies to this topic

#1 Van Helsing

Van Helsing

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 10 April 2007 - 08:30 AM

Hi,

I've googled Javascript validation for ages now and can't seem to find what I'm looking for.

All I need is a script to check whether a field contains an exact code. For example,

A user goes through a game, collects pieces of the code - In this case random numbers or letters to form a 9 digit code.

The user can then enter this code into the field, hit submit and told whether they've cracked the code or not.

So basically something like, if this field contains "123456789" then go to WellDone.html but if it contains anything else other than this code then go to Fail.html ,

any ideas?

Thanks,
-Van

#2 Ben

Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 11 April 2007 - 09:02 PM

It would only really work if you did this with PHP or ASP, because with javascript they'll be able to view the source and find the answer.

#3 Van Helsing

Van Helsing

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 12 April 2007 - 09:59 AM

That doesn't matter,

It's nothing 'serious' just a little game of sorts,




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users