www.webdeveloper.com
Results 1 to 4 of 4

Thread: Returining True/False from iframe function

  1. #1
    Join Date
    Jul 2009
    Posts
    8

    Returining True/False from iframe function

    Hello,

    The following function returns true/false and I would like to obtain the value from that function. The function resides in an iframe and it submits and validates a form within that iframe. Im executing the function from the parent like so..

    return window.frames[frameid].submitHandler(); (works fine)

    Apparently I cannot do this..

    var newvar = return window.frames[frameid].submitHandler();

    Anyone know how I can retrieve the true/false value?

    Thanks for your help!
    Last edited by sumnerdu; 08-17-2009 at 03:26 PM.

  2. #2
    Join Date
    Jun 2007
    Posts
    667
    Code:
    var newvar = window.frames[frameid].submitHandler();

  3. #3
    Join Date
    Jul 2009
    Posts
    8
    Hmm..

    That returns an "undefined" value rather than true/false.

  4. #4
    Join Date
    Jun 2007
    Posts
    667
    Quote Originally Posted by sumnerdu View Post
    Hmm..

    That returns an "undefined" value rather than true/false.
    When are you calling the function?

    If it's on load, you must check that the iframe has loaded.

    I don't know what scope newvar needs to have, but you might try something like:
    Code:
     (function sendForm()
     {
      try
      { 
       newvar = return window.frames[frameid].submitHandler();
      }
      catch(e){ setTimeout( sendForm, 1000 ); }
     })();

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