Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    referencing a form in a frame from another frame

    I have to reference a control (name="datefrom") from a form (dateform) in a frame (reportcontrols). the code that does it is in another frame in teh same frameset (which is contained in an iframe).

    the code i use to do this is:

    parent.reportcontrols.dateform.datefrom.value

    which works in ie but not in ff,

    what is the equiv in ff and will that work in ie ?

    TIA

  • #2
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well i figured it out:

    this did the trick in both browsers:

    parent.reportcontrols.document.dateform.datefrom.value

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    try using most of the time the full squared reference. It will help you avoid errors if you have names such as "name_01" or :"name%02_01" or you might need change dynamically something. And don't forget to specify document as root in case of a document's element. IE will accept without this specification, but this is corrupt way of referencing, thus no other browser will take it, i am affraid.

    parent.frames['reportcontrols'].document.forms['dateform'].elements['datefrom'].value
    or
    top.frames['reportcontrols'].document.forms['dateform'].elements['datefrom'].value
    Last edited by Kor; 04-14-2005 at 04:17 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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