www.webdeveloper.com
Results 1 to 2 of 2

Thread: Works for some users but not all

  1. #1
    Join Date
    Jul 2009
    Posts
    1

    Works for some users but not all

    I have a function that submits a form, calls a function to refreh the main page and closes the window. It works perfectly for me, but fails when another user tries it. We are both logging in to the same computer (so there is no difference in the browser version).

    the function calls are as follows:
    function submitForm() {
    window.setTimeout('document.editLostForm.submit()', 0);
    window.setTimeout('window.opener.timedRefresh(); window.close()', 20);
    }

    if I place an alert in after the the submit(), it works for everyone. I thought the setTimeout() call would resolve the problem, but it persits.

    Any ideas?

  2. #2
    Join Date
    Jun 2007
    Posts
    667
    The moment a form is submitted, it's containing page is dismissed, so any pending timeouts can't be guaranteed.
    Submit the form with a submit-type button.
    The onsubmit handler should call a function in the opener which closes the window it opened, then refreshes its own document.
    Y_U U_G_A_E_U_ B_S_A_D_

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles