Click to See Complete Forum and Search --> : Accessing input hidden fields from another frame


mili
07-03-2003, 12:33 PM
I have two frames in a page.One on top & one in the bottom.I have some input hidden fields in the top frame that I need to access from the bottom frame.How can I do this using JS?

ccoder
07-03-2003, 12:49 PM
parent.framename.document.formname.inputfieldname should work. There may be a better way of referencing the input fields, but I'm still learning myself.

mili
07-03-2003, 04:13 PM
Thanks for your help.I tried and it does not work :(

I have frame on top with input hidden variables.
In the bottom frame I have a form with a submit button.When I hit submit, I want to grab the hidden variables from top frame and post it along with the form.
Please can some one help me with this?

Thanks

ccoder
07-04-2003, 10:34 AM
Copy the hidden inputs from the top frame to the bottem frame before submitting, i.e.:

if (firstchrt)
{
firstchrt = !firstchrt;
chartframe.document.frmIntro.jobid.value =
selectframe.document.frmSelect.selLocale.options[locIndx].value;
chartframe.document.frmIntro.jobdate.value = reqDate;
chartframe.document.frmIntro.submit();
}
else
{
chartframe.document.frmChart.jobid.value =
selectframe.document.frmSelect.selLocale.options[locIndx].value;
chartframe.document.frmChart.jobdate.value = reqDate;
chartframe.document.frmChart.submit();
}

This code is in my parent form, so the references to parent (that I posted earlier) are omitted in this example.