Connecting Tech Pros Worldwide Help | Site Map

Compare text in a textarea

Newbie
 
Join Date: Jul 2007
Posts: 2
#1: Jul 10 '07
I need users to enter some words in textarea in my webpage. Once they submit the form how can i compare the entered words with some predefined text and provide the result using javascript.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jul 10 '07

re: Compare text in a textarea


Welcome to TSDN!

Once they submit the form, it will go to a server-side script presumably. So you want to compare before the form is submitted, right?

How do you wish to compare?
Newbie
 
Join Date: Jul 2007
Posts: 2
#3: Jul 10 '07

re: Compare text in a textarea


i need to make a memory test page. users hear an audio containing some words and they have to type it in a text area. once they press the submit button i need to tell them how many correct words they have recalled.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Jul 11 '07

re: Compare text in a textarea


Quote:

Originally Posted by deepthiu

i need to make a memory test page. users hear an audio containing some words and they have to type it in a text area. once they press the submit button i need to tell them how many correct words they have recalled.

Do you want this on the same page or the next page? If it's on the next page, you might as well test on the server-side. If on the same page, using Javascript, someone could check the source code and cheat! One way out of that is to use Ajax.
Reply