Reply
Mon 5 Feb, 2007 11:34 am
Hi there !!
How can I check a textbox (like this one, for example) for a string (like "chuck") ?? I want to check this when I press a button !!
I want to be sure no offending letters are used before submitting in a forum, and that when this offending letter is found, it should pop up a message.. else OK !!
Thanks guys..
Your help urgently requested.
Regards,
Bijon
You can access the form input at: document.formname.inputname.value in javascript.
Then run what you want on it and alert/popup as desired.
Of course, to truly scale you should use post-backs and "AJAX".
Or, alternatively, document.getElementById("YourTextareaID").value
Regular expressions used correctly can also be very helpful for many kinds of validation.