35 users online (2 members and 33 guests)  


  Results 1 to 2 of 2

Related

  1. need help with onclick link to external .JS file    Forum: Javascript Forum
    Replies: 0
  2. Sending CSV file with Japanese to browser    Forum: CGI Perl Forum
    Replies: 0
  3. help checking form elements in external js file    Forum: Javascript Forum
    Replies: 2
  4. passing values to an external .js file    Forum: Javascript Forum
    Replies: 10
  5. Sending selected form fields    Forum: HTML Forum
    Replies: 1
  1. #1
    digger's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jan 2005
    Posts
    36

    checking passwords with an external js file then sending a form if ok

    all this is on a html file at the moment would like to have the password check in an external file if possible

    full code follows

    //password check


    <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
    password = new Array(
    "test2@email.com",
    "test3@email.com",
    "test4@email.com",
    "test5@email.com")
    function Check() {
    //Change FORM and FIELD to the form name and field name throughout this function
    passwordchk=document.login.password.value.toLowerCase()
    awdrgy = 0
    aLeRt = 0
    {
    if (passwordchk < password[awdrgy]) {
    aLeRt = 1
    alert("You do not have privileges to use this site")
    document.login.password.value=""
    }
    awdrgy++
    }
    }
    -->
    </script>


    // form
    <form action="/cgi-bin/formmail.pl" method="post"name="login" id="login" onsubmit="return FSubmitValidation(this)">
    <input type=hidden name="recipient" value="logon@xxxxxx.com">
    <input type=hidden name="subject" value="Logon to Team Site">
    <input type=hidden name="redirect"value="http://www.xxxxxx.com/team/main.htm" >

    <input type="hidden" name="PAGE" value="none"><input type="hidden" name="REFERRER"
    value="none"><input type="hidden" name="PLATFORM" value="none"><input type="hidden"
    name="LOADING_TIME" value="none"><div align="center"><center>


    <table width=425 border=1 cellpadding=3>
    <tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
    <tr><td>Username:</td><td><input type="text" name="username"></td></tr>

    <tr><td>Password:</td><td><input type="password" name="password" onblur="Check();" onblur ></td></tr>

    <tr><td colspan=2 align=center><INPUT TYPE="SUBMIT" NAME="submitinfo" VALUE="Enter!" CHECKED="CHECKED" STYLE="font-family: Arial; background-color: #33FFFF; color: navy; font-weight: bold">

    &nbsp;&nbsp;&nbsp;


    <INPUT TYPE="RESET" NAME="Reset1"STYLE="font-family: Arial; font-weight: bold; color: navy; background-color: #33FFFF"></td></tr>
    </table>

    is it possible to have the java check in an external js file and if so how would i call it

    thanks

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Ah, I wish I had seen this one first, then I wouldn't have had to split your post from 2year-old topic.

    I answered here: http://www.ahfb2000.com/webmaster_he...ead.php?t=3910

    Welcome to the forums btw
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread