SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Denmark
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help (urgent)

    Hi guys,

    I got a small problem, however can't find the error.

    Here's the problem:

    There is Login page. When typed down id and password the function calls for two seperate frames on the left side (leftFrame1) and the bodyframe(mainFrame1). In fact it does that successfully. So, two pages appear to be ok. After that there's some codes on the bodyframe(mainFrame1) which calles for the function to count down the time (from 10 and down) til 0. Afterwards it takes you to the previous Login area. However it happens only in case of no interaction with computer.

    So here're some codes.

    1) for the calling two frames from Login area:

    function pasuser(form) {
    if (form.id.value=="ura") {
    if (form.pass.value=="1234567") {
    parent.mainFrame.location.href = "mainFrame1.htm";
    parent.leftFrame.location.href = "leftFrame1.htm";
    } else {
    alert("Invalid Password")
    }
    } else {
    alert("Invalid UserID")
    }
    }

    2) and for redirection:

    function Redirect() {
    document.page_time.timerdis.value = counter
    counter--
    if(counter <= 0) {
    window.frame['leftFrame1'].location.href = "leftFrame.htm";
    document.mainFrame1.location.href = "mainFrame.htm";
    }


    WHAT is WRONG here people? Why doesn't it work?

    much appreciate any help.

  2. #2
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Denmark
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GREAT!!! I found the errror.

    Another question guys,

    I need to fire a function that would control not only mouse movement but also keyboard ... so i got some scripts, but the function for keypress doesn't work, why?

    here is the code:

    function resetcount() {
    counter = 10
    }

    if(document.getElementById&&!document.all) { // for ns6+ only
    document.captureEvents(Event.MOUSEMOVE)
    }
    document.onmousemove = resetcount;
    document.onKeyPress = resetcount; (is this right)


    thanks in advance for help.

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    document.onKeyPress is your problem. Event properties are all lowercase: document.onkeypress will fix you up
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Denmark
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey beetle,

    thanks for feedback, but u know it didn't work anyway ... so i started thinking that there was an error up there..

    i don't what's going on.

    PLEASE look it up

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, without seeing the script in a page, I'm not really sure.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  6. #6
    SitePoint Addict
    Join Date
    Aug 2001
    Location
    Los Angeles, CA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if(document.getElementById&&!document.all) { // for ns6+ only
    What the heck is this all about? document.all is for IE browsers only, if I'm not mistaken...

  7. #7
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if (
    document.getElementById [exists?]
    && [and]
    ! [not] document.all [exists?]
    )

    Looks like it will reasonably single out Gecko to me, whats confusing greg?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  8. #8
    SitePoint Addict
    Join Date
    Aug 2001
    Location
    Los Angeles, CA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh, LOL...I didn't notice the exclamation point...hehehe, I should pay better attention before I post...then again I'm more used to reading my code, which I space more than most people do so it's easier to go through and read...

  9. #9
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe - likewise, I use alot more spacing than normal as well
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •