SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: Log in Script

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    East Side
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Log in Script

    Hi all -

    Just a quick question concerning log in scripts - (This is being used as a demo) What I am attempting to do is to have a log in screen and the user will put in a specific ID (password irrelevant) and when they click on "go" or "continue" the page will direct them to a specific page determined by whatever ID they had used. Searched around for scripts but was unable to find any...

    Any suggestions?

    Thanks!

  2. #2
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This what your looking for?

    <script>
    function getit() {
    if (document.former.IDS.value == "id1") {location.replace('http://altavista.com')}
    else if (document.former.IDS.value == "id2"){location.replace('http://northernlight.com')}
    else {alert("That username is not on the list")}

    }
    </script>
    <form name="former">
    <input type="text" name="IDS">
    <input type="button" value="GO" onClick="getit()">
    </form>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    East Side
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is exactly it! Thanks Disk-T - you've greatly helped out!

  4. #4
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hurray! I did something right!

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    East Side
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Disk-T (or anyone else for that matter) - here is you chance to really do something great... how do I make an image act like that "go" button???

    Thanks!

  6. #6
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just edit the bold areas of the script.

    <script>
    function getit() {
    if (document.former.IDS.value == "User id") {location.replace('location to go to')}
    else if (document.former.IDS.value == "User id"){location.replace('location to go to')}
    else {alert("That username is not on the list")}

    }
    var p1 = new Image();
    p1.src='Locaction of picture number 1';

    var p2 = new Image();
    p2.src='Locaction of picture number 2';

    </script>
    <form name="former">
    <input type="text" name="IDS">
    </form>



    <img name="img1" onClick="getit()" src="Locaction of picture number 1" onMouseover="document.images.img1.src='Locaction of picture number 2'" onMouseout="document.images.img1.src='Locaction of picture number 1'" width="141" height="34">

  7. #7
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Picture number one = Unselected GO button
    Picture number two = selected GO button

  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    East Side
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Disk-t!

  9. #9
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    East Side
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course now that we have gotten that script to work - they want it changed. So here is the new scenario -

    There is going to be three radio buttons and two text fields. What needs to happen is that someone must check a radio button and put in a range of dates into the text fields. The first field being the oldest date and the second field being the newest one. When they click on that go button, a page is going to show up depending on what radio button was clicked and what dates were put in.... how is this done?!

    Thanks for your help - it is really appreciated!


Bookmarks

Posting Permissions

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