[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?
If I were you, I would try a line like this:
onClick="parent.total.forms[?].textbox.value='5'";
where '?' is an integer (w/o quotes!) of the frame in order of
appearance. I have tried addressing the form ny name in THE SAME page,
and it was giving me the same message as for you. After I addressed it
with an index it changed for better.
Cheers,
Edas