SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting form values from an IFRAME

    I've got a form that has plenty of fields but also includes an IFRAME. The IFRAME has a list of links and I want to set a value in the main doc depending on the link clicked in the IFRAME.

    Any ideas?
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  2. #2
    SitePoint Enthusiast jpp's Avatar
    Join Date
    Nov 2003
    Location
    Arnhem, The Netherlands
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bigsi
    I've got a form that has plenty of fields but also includes an IFRAME. The IFRAME has a list of links and I want to set a value in the main doc depending on the link clicked in the IFRAME.

    Any ideas?
    Make the links in the iframe call a function and parse the value to this function and within this function set the value of the formobject to the received value?

    somethinglike:

    <a href="javascript:whateverfunction('whatevervalue');">link</a>

    function whateverfunction(whatevervalue)
    {
    document.all.form.field.value = whatevervalue;
    };

  3. #3
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers for the input JPP - I managed to work it out in the end. Not as difficult as I thought it was - I just used the "parent.frmName.varName.value" call from within the iframe.
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.



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
  •