• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Javascript> Check for specific email address

Mar16
2011
Written by Scott Rowley
<script>
//function to check for a specific email address
function donotreply()
{
if (document.forms["reply"]["send_to"].value == 'do-not-reply@example.com')
{
alert('You would try to send to the one address yer not allowed to....try again!');
return false;
}
return true;
}
</script>

And the form entries…

<form name="reply" onsubmit="return donotreply()">
<input type="text" name="send_to">
Posted in Javascript
« Perl> Useful one-liners
» Web Dev> Report on server script status using popen

5 Comments

  1. June's Gravatar June
    July 7, 2011 at 4:57 pm

    Hi Scott,
    Just to like to thank you for the information.
    I run an online bulletin board for my co-workers and had been seeking how to check a particular someone’s entry as she kept ignoring social etiquette.
    This script should work nicely. 😉
    Thanks again and keep up great work!

    • Scott Rowley's Gravatar Scott Rowley
      July 7, 2011 at 7:27 pm

      Awesome, glad it worked for you. Thanks for the feedback! 🙂

  2. June's Gravatar June
    July 30, 2011 at 2:23 am

    Hello again,
    I wonder if there is also a way to check for bad words within email address?
    Thanks in advance for your expertise.

    • Scott Rowley's Gravatar Scott Rowley
      July 30, 2011 at 9:38 am

      Certainly,

      http://sudobash.net/?p=181

      I’m not sure exactly how to implement that in conjunction with this without testing and I don’t have the time to test right now but that should get you started. 🙂

      • June's Gravatar June
        August 1, 2011 at 12:25 am

        Thanks kindly for your speedy response! I will see if I can manage to work on it. 🙂

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top