#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Norway
    Posts
    4
    Rep Power
    0

    Javascript href-link


    I am making a log-in page with javascript.
    The idea of this page, is that there are only three different user-names, and each of these will direct you to a different page.
    user1 goes to user1.html, user2 goes to user2.html and so on.

    How can I do this, by now I have this html-code with some scripting in it.

    <html>

    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>[ Horeka A/S - Innlogging]</title>
    </head>

    <body bgproperties="fixed" background="../horekabakgrunnhtml.jpg" style="font-family: verdana; font-size: 12pt">
    <script Language="JavaScript"><!--
    function sjekkp(){
    var kundenummer=theForm.kundenr.value; //brukerens studentnummer
    var passord=theForm.passord.value;
    if((kundenummer=="horeka")AND(passord=="anders"))

    }

    //-->
    </script>
    <p align="center"><b><font size="5">Logg inn</font></b></p>
    <p align="center">&nbsp;</p>
    <p align="left">Skriv inn ditt brukernavn og passord.</p>
    <p align="left">Hvis du ikke er registrert bruker enda, registrer deg
    <a style="color: #000000" href="skjema.html">her</a>.<br>
    </p>
    <form method="POST" action="" onsubmit=""sjekkp()">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
    <td width="25">Brukernavn</td>
    <td width="75%"><input type="text" name="kundenr" size="17"></td>
    </tr>
    <tr>
    <td width="25">Passord</td>
    <td width="50%"><input type="password" name="passord" size="17"</td>
    </tr>
    </table>
    <p><input type="submit" value="Logg inn" name="B1"><input type="reset" value="Tilbakestill" name="B2"></p>
    </form>

    </body>

    </html>

    Thank you in advance!

    El scorcho
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Pune, India
    Posts
    31
    Rep Power
    12
    Try something like this

    <html>
    <head>
    <script>
    function setAction()
    {
    if(form1.text1.value=="b")
    form1.setAttribute("action","b.htm");
    if(form1.text1.value=="c")
    form1.setAttribute("action","c.htm");
    }
    </script>
    </head>
    <body>
    <form name="form1" method="post">
    <input type="text" name="text1">
    <input type="submit" value="sign in" onClick="setAction()">
    </form>
    </body>
    </html>
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Norway
    Posts
    4
    Rep Power
    0

    Thank you


    Thank yoy very much...this worked perfect!!

IMN logo majestic logo threadwatch logo seochat tools logo