Re: access parent window object from inside iframe

From: Michael Harris \(MVP\) ("Michael)
Date: 03/09/04


Date: Mon, 8 Mar 2004 19:45:30 -0800


> From PageB.htm how can I write to the Hidden Input's value
> (hMssg.value="something new")?
>
> From within PageB.htm I've tried
> <script type=text/vbscript lang=vbscript>
> window.parent.document.forms("fMssg",0).elements("hMssg").value =
> "GO" </script>

I would try it with only the string index into the forms collection:

  window.parent.document.forms("fMssg").elements("hMssg").value = "GO"

The second integer argument, iSubIndex, is (according to the
documentation)...

"...
iSubIndex Optional. Position of an element to retrieve. This parameter is
used when vIndex is a string. The method uses the string to construct a
collection of all elements that have a name or id property equal to the
string, and then retrieves from this collection the element at the position
specified by iSubIndex.
..."

Given that you include .elements("hMssg") to reference the element, I don't
see how you would need iSubIndex.

>
> But I get an error message "Error: Object required
> 'window.parent.document.forms(...)'"
>
> Any help would be appreciated.
> JP

-- 
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US


Relevant Pages

  • Re: Getting command line of another process
    ... It seems to be very complicated code just to retrieve the command line of a process. ... static public bool RetrieveUserModeProcessString(IntPtr HandleProcess, IntPtr PageBaseAddress, UInt32 UnicodeStringOffset, out string Result) ... UInt32 UnicodeStringSize = 8; ... pStringContent = Marshal.AllocCoTaskMemStringLength); ...
    (microsoft.public.win32.programmer.kernel)
  • Case insensitive keys using Collections
    ... I'm looking for container (hashmap or set), into which I can put key ... KeyValueObject keyvalue = new KeyValueObject; ... won't be able to retrieve the objects using a simple String in the ...
    (comp.lang.java.programmer)
  • Very simple Java problem, please help
    ... delete latent messages and nicknames that linger on the server more ... I set up a few JSP scripts that will retrieve and remove these files by ... @param String fileName ... Vector contentVector = getFileContents; ...
    (comp.lang.java.programmer)
  • Very simple Java problem, please help
    ... delete latent messages and nicknames that linger on the server more ... I set up a few JSP scripts that will retrieve and remove these files by ... @param String fileName ... Vector contentVector = getFileContents; ...
    (comp.lang.java.help)
  • Re: Getting command line of another process
    ... It seems to be very complicated code just to retrieve the command line of a ... HandleProcess, IntPtr PageBaseAddress, UInt32 UnicodeStringOffset, out string ... pUnicodeStringAddress, pUnicodeString, UnicodeStringSize, out ... pStringContent = Marshal.AllocCoTaskMemStringLength); ...
    (microsoft.public.win32.programmer.kernel)