SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    ca
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple settimer help...

    PHP Code:
    <!-- 
    function 
    submitForm() 

    window.setTimeout(document.email_inner.submit(),5000); 

    //--> 
    im trying to submit my forum after 5 secounds of viewing the page and i have no knowlege of java wat fo ever but ey told me this is the onlyway to do such a thing ... this i wat i have so far in hte header .... it dose nothing at all

  2. #2
    SitePoint Addict Guimauve's Avatar
    Join Date
    Aug 2004
    Location
    Chicago
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by invader980
    PHP Code:
    <!-- 
    function 
    submitForm() 

    window.setTimeout(document.email_inner.submit(),5000); 

    //--> 
    im trying to submit my forum after 5 secounds of viewing the page and i have no knowlege of java wat fo ever but ey told me this is the onlyway to do such a thing ... this i wat i have so far in hte header .... it dose nothing at all
    I'm not exactly sure what you are trying to do...

    I asume that email_inner is the form name?

    Did you call submitForm from the body onload event? If not then the submitForm function never gets called...

    Charles

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    ca
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Guimauve
    I'm not exactly sure what you are trying to do...

    I asume that email_inner is the form name?

    Did you call submitForm from the body onload event? If not then the submitForm function never gets called...

    Charles

    yeha i figured thats how it works , u define hte functions give it its instructions and then call it some time in the page ..... only when i called the function onload from the body tag it redirected almost imediatly witch pretty much defeated the pourpus..... so i figured the onload was preforming its own submit because of the functions name .... idono but i took the onload call out and now it dose absolutly nothing ....

  4. #4
    SitePoint Addict Guimauve's Avatar
    Join Date
    Aug 2004
    Location
    Chicago
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by invader980
    yeha i figured thats how it works , u define hte functions give it its instructions and then call it some time in the page ..... only when i called the function onload from the body tag it redirected almost imediatly witch pretty much defeated the pourpus..... so i figured the onload was preforming its own submit because of the functions name .... idono but i took the onload call out and now it dose absolutly nothing ....
    The function name is not the cause of the page submitting that's for sure. It may be more an issue of perception from when the page looks done and when the page is actually considered loaded from the browser.

    Try setting the timeout value a little higher than 5000ms

    Also, can you explain why you want the form to submit automatically? In my opinion it sounds like you are creating usability and accessibility problems for your users.

    Charles

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    ca
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well , o and by the way if u cant tell i have no knwlege of javascript , the script i made is basicly for an automated email newletter the user is sending , But because i want the user to be able to costumize portions of the email i need to pass along the parts that are already created tothe next page because i dont want the page to reload on its self over and over.... This section of the email basicly adds another chunk of html to the newletter along with some other functions , while it shows the user a preview of what the email will consist of ,because this is the last page befor sending... So i might as well add the extra piecese to the email while the user is previewing the email. Sending hidden form fields was the easiest way for me to do this...with out other functionality probs

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    ca
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol .... and now its working sorry agine ... ive been having server update probs lately man its driving me crazy its a pain to keep searching threw code i know should be working after every update ....... my server keeps screwing up my uploads every once and a while ... and soo i get the confirmation my page is updated onthe server .... but it realy isn't so my problem was from an old script i was testing that was set at a fast speed ..... sorry for bugging you ... this i liek the 5th time this has happend in hte last 2 days man , and i keep comming here because i am completly lost as to what the problem is ... thanx agine


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
  •