[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frames and forms help.



>
>        I am writing a page with JS and frames, and I have a question about
>accessing forms from different frames.  Each frame conatains documents with
>some of their own JS <script> and a form.  I am trying to get an onClick()
>on one form to copy a value from another form in another frame. like putting
>in one script:
>                        onClick="parent.total.myform.textbox.value='5'";
>
>where total is a named frame, myform is a named form in it, and textbox is
>in that form.  This line is on a form in another named frame. What I always
>get back is a "myform has no properties" error. Is there a way to get into
>one form's fields from another form/file/script? Or will i have to make
>variables to hold the data, and then trigger a function on the other page to
>read it in?
>
>                                        Any help appreciated,
>                                        Steven Weinberger
>

Try parent.total.document.myform.textbox.value (note the 'document').
Also, try replacing parent with window, total with frames[n].

-- Yoz

|  |,,-.---. Yoram Grahame - yoz@ucl.ac.uk , yoz@delphi.com
`--1 `-' ==; WWW: http://www.cs.ucl.ac.uk/students/Y.Grahame/
,-'|       ; "Right here, right now, friend, I'm as nervous as a cotton-pickin'
`--' ,----'   frog on a freeway with its hopper busted... I'm in bad shape."