Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Thanked 0 Times in 0 Posts

    Question Please help me with this script.. Thanks :)

    Hi I have found a script I would like to make a few changes to.. I have tried a few tricks but got me no-where.

    If you could help me I will be very much appreciated!
    <script language="javascript">
    //These are the names of the people you don't want
    //To add a person, just put their name in quotation marks
    //and add a comma after
    Names = new Array(
    function Check() {
     //Change FORM and FIELD to the form name and field name throughout this function
     awdrgy = 0
     aLeRt = 0
     while (awdrgy<=Names.length-1 && aLeRt!=1) {
      if (namechk==Names[awdrgy]) {
       aLeRt = 1
       alert("Either your account is suspended or you entered an invalid email address! Please try again.")
    <form name="FORM">
    <input name="FIELD" onblur="Check();" onblur>
    <input type="button" onclick=storytest() value="Submit" class="form">
    <!-- Script Size:  2.01 KB -->
    Basically What I want to happen is..

    If a email entered that is listed in the reject list they will get an alert. (This currently does this)

    If a email was entered that's not listed it will submit the form. (Currently does not do this)

    I am making a login form that is complete but I wanted to add the above code to it..

    If you or anyone could make it work the way I explained above I will be very much appreciated.


    Last edited by Kor; 12-14-2009 at 10:32 AM.

  2. #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Thanked 330 Times in 326 Posts
    This has nothing to do with either JSON or DOM, so it would be better placed elsewhere. A moderator can move it for you.

    This code isn't intended to actually be used in production anywhere is it? It shouldn't be.

    The form won't submit because you've not defined an action. Check out this page for some elementary information on HTML forms.
    Are you a Help Vampire?

  3. #3
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Bucharest, ROMANIA
    Thanked 379 Times in 375 Posts
    Moved in main Javascript Forum.
    Offshore programming

  4. #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,704 Times in 2,680 Posts
    <script language=javascript> is long deprecated and obsolete. Use <script type = "text/javascript"> instead.
    The <!-- and //--> comment (hiding) tags have not been necessary since IE3. If you see these in some published script it is a warning that you are looking at ancient and perhaps (as here) unreliable code.

    This is easily circumvented if JavaScript is disabled. JavaScript form validation only provides convenience for users, not security. This means that JavaScript should be used as an "enhancement", not as a requirement. So your form should not be dependent on JavaScript alone to perform your validation. Instead, whatever server-side language you use to process the form (PERL, ASP, PHP, etc.) should also perform the same validation. Otherwise, people will be able to bypass your validation (and even possibly inject malicious code) simply by disabling JavaScript.

    Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts