• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 878
  • Last Modified:

set a value in a form whin an iFrame

Hello Everyone,
   I am trying to set a value in a input text element within an iframe.....
   let me use expert-exchange JavaScript topic area as an example...

iframe:

<iframe id="objViewer" style="HEIGHT: 95%; LEFT: 17%; OVERFLOW: auto; POSITION: absolute; TOP: 5%; WIDTH: 85%"height="400" width="1000" scrolling="Yes" src="http://www.experts-exchange.com/Web/Web_Languages/JavaScript/" frameborder="1"></iframe>

            <select name="selLink" style="width: 136px" onchange="sendInfo(this.options[this.selectedIndex].value)">
                    <option value="Ace">ACE</option>
                    <option value="Image View">Image View</option>
                    <option value="value test">Value Test</option>
            </select>

script:

      function sendInfo(dText)
      {
        switch(dText)
        {
            case "value test":
                //////////////////////////// What do i place here to be able to access the form in the iframe to set the value
                                                    say for example: Form(SearchForm)
                                                                             Input Text(query)
                break;
        }
      }

thnx
tony_813
0
tony_813
Asked:
tony_813
  • 2
1 Solution
 
pvginkelCommented:
Try this:

frames['objViewer'].document.getElementById('query').value = 'the value of the query';
0
 
tony_813Author Commented:
thns for the quick reponse...
I tried your suggestion and I got the following error message:

    Access is denied.
0
 
bubbledragonCommented:
For browse security, cannot access the frame that in different domain, you will get "Permission Denied" when Scripting Across Frames (at least in IE).

To Create Cross-Frame Scripting-Capable Web Pages with HTML Applications (HTAs) http://support.microsoft.com/default.aspx?scid=kb;en-us;241754
0
 
tony_813Author Commented:
errrrrrrrrrrr
    not the info I wanted to say..... but hey.. at leas i'm not going to be here all night trying to get it to work..

thank you for you info

tony_813
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now