Click to See Complete Forum and Search --> : Submit form to two frames


Ruiner
01-26-2003, 05:36 PM
I need to submit the value from a drop down box to the frame the form is in and to another frame. How would i go about this?

Webskater
01-26-2003, 05:49 PM
Let's say you have a frames page with a frame called Left and a frame called Right.
The form with the drop down list is in a form called RightForm and when the form is submitted you want the value passed to a control on the Left frame called PassedValue which is on a form called LeftForm. The drop down list is called MyList.
The form on the RightForm is submitted by a button. This calls a function like this:

<input type=button onclick="TransferValue()" value="Submit">

The function does this:

function TransferValue()
{
var ValueToPass = RightForm.MyList.selectedIndex.value;
window.parent.frames('Left').LeftForm.PassedValue.value = ValueToPass;
RightForm.submit()
}

Ruiner
01-26-2003, 09:38 PM
This I think will work, but I actually did the main programming in ASP. This script doesn't seem to update the pages in the frames for the ASP to read the form values. what can I add to this function to make it update the pages?

Ruiner
01-27-2003, 10:12 PM
This is what i am using for the function to pass a value from a form to two frames.

function TransferValue()
{
var ValueToPass = gallery.gn.selectedIndex.value;
window.self.location.='photodisplay.asp?gn='+ValueToPass;
}

The form name is gallery and the dropdown box name is gn. I set the form to submit to the other frame, and now I need the javascript to submit the form to the frame where the form is located. This function is calledup on a onSubmit in the submit button of the form. This doesn't seem to be working though. The form is submitted to the other frame okay, but it won't submit to the frames the form is located in. Am I retriieving the value from the form correctly? Did I make a proper link line?

I'm new to javascript, so I could use a lot of help. Thanks