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

Most Popular

  • osTickets > Reports v4.1 (11806)
  • HTPC > Setup Windows 7 as a Media Center with XBMC (6369)
  • osTicket > Auto-Assignment Rules (3602)
  • osTicket > View headers for original email message (2331)
  • Ubuntu 10.10 VNC Login Screen (2161)

Posts in category Javascript

Javascript > Check for specific email address

Mar16
2011
5 Comments Written by Scott Rowley
<script type="text/javascript">
//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">
ajax loader
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Javascript > Check if string contains VARIABLE

Oct26
2010
Leave a Comment Written by Scott Rowley

Just a bit of code to help you find whether or not a certain word/phrase/letter/number/whatever is present in something like a form entry.

if (TEXT.match(/b<VARIABLE>b/i) != null) {
alert(true);
}

For instance, I have a domain registration form and we know there are no spaces allowed in domain names, so:

if (TEXT.match(/b b/i) != null) {
alert(true);
}
ajax loader
Posted in Web Development - Tagged alert, contain, string, variable
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Javascript > Reference Javascript (.js) file

Oct26
2010
Leave a Comment Written by Scott Rowley

Sometimes we have so much javascript code in our files that it just becomes bulky and gets in the way.  Instead of including it all in your file, save it all to a seperate file that can be referenced in your page (or better yet multiple pages).
Simply place the following within your <head> tags:

<script language="javascript" src="/path/to/file.js"></script>
ajax loader
Posted in Web Development - Tagged code, reference, Web Development
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Be Heard!

Authors needed! Feel like sharing your tech wisdom with the world? We are looking to expand our writer base and would love to hear from you. We need articles on any relevant technology/software/media/howto/etc (Well...lets at least hold to the legal stuff ;)

Just email scott (at) sudobash (dot) net

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

Sudo Bash Member sites

Des Moines, Iowa Karate Classes
Iowa MMA Tournaments
Iowa SAR

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS HowToGeek

  • DIY Digital POV Clock On a Hard Drive Platter
  • How to Disable the Splash Screens in Office (Word, Excel, PowerPoint)
  • How To Resolve Dependencies While Compiling Software on Ubuntu
  • Version Tracking With Subversion (SVN) For Beginners
  • How to Set Up Email Notifications for Your Windows Home Server

RSS TheGeekStuff

  • How to Install GIT for Windows and Create / Clone Remote Repositories
  • 5 Practical Linux fuser Command Examples
  • Linux Memory Management – Virtual Memory and Demand Paging
  • XSS Attack Examples (Cross-Site Scripting Attacks)
  • 10 Things You (and Your Boss) Can Do To Change Your World

RSS LifeHacker

  • Remove Clothing Wrinkles with a Damp Towel [Clothes]
  • Factor in the Convenience Fee Before Charging Income Taxes to Your Credit Card [Taxes]
  • How to Block Annoying Tech Rumors and Movie Spoilers on Your Browser [Annoyances]
  • Use Plastic Shower Caps in the Kitchen to Cover Large Bowls and Leftovers [Clever Uses]
  • Twitter for iOS and Android Updates, Restores Swipe Gestures and Optimizes for Android Tablets [Updates]

EvoLve theme by Blogatize  •  Powered by WordPress Sudo Bash
By Geeks - For Geeks

Back to Top