By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,423 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,423 IT Pros & Developers. It's quick & easy.

Using form data from one frame in another frame

P: n/a
I hope you can help as this is driving me crazy!

I have an asp which has 3 frames on it as follows:

<FRAMESET rows="50%,*,10%">
<FRAME src="rundetailstop.asp" name="rundetailstop" scrolling="no">
<FRAME src="rundetails.asp" name="rundetails" scrolling="auto">
<FRAME src="rundetailsbottom.asp" name="rundetailsbottom"
scrolling="no">
</FRAMESET>

The top frame(rundetailstop) is the heading, the middle
frame(rundetails) has the data within a form and the bottom
frame(rundetailsbottom) has some buttons on it within a form.

When a button is clicked in the bottom frame it submits the form and
goes off to a different ASP to do some processing. The problem is that
I need to take one piece of data from the middle form with me. The
middle frame has a textfield which contains a number I need to take
with me.

I'm assuming in the ASP I go off to when the button is clicked I can
only get the data from the form the request has come from (using
request.form("variablename")) and there is no way to get data from one
of the other frames on the page?

So what I tried to do is go to a client-side function within the
bottom frame when a button is pressed. This function will get the
value from the middle frame and store it in a hidden field on the
bottom frame. This is the bit I can't figure out how to do!!!! The
function call works but my attempt at getting the data out of the
other frame fails miserably! I'm trying using

parent.frames["rundetails"].document.form1.id

id is the name of the variable I need and form1 is the name of my form
within the rundetails frame.

I'm using VBScript to do this.

Where am I going wrong??

Yours hopefully!
Kathryn.
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
a) How did the data from the middle frame get there? Did your code put it
there? If so, you could put the value in a Session variable.
b) In your bottom frame add a hidden input -- <input type=hidden
name=HiddenValue value=""> -- Using Client side code add an event handler
for the onSubmit function that populates the value of your Hidden form
field.
"Kathryn" <an******@hotmail.com> wrote in message
news:42*************************@posting.google.co m...
I hope you can help as this is driving me crazy!

I have an asp which has 3 frames on it as follows:

<FRAMESET rows="50%,*,10%">
<FRAME src="rundetailstop.asp" name="rundetailstop" scrolling="no">
<FRAME src="rundetails.asp" name="rundetails" scrolling="auto">
<FRAME src="rundetailsbottom.asp" name="rundetailsbottom"
scrolling="no">
</FRAMESET>

The top frame(rundetailstop) is the heading, the middle
frame(rundetails) has the data within a form and the bottom
frame(rundetailsbottom) has some buttons on it within a form.

When a button is clicked in the bottom frame it submits the form and
goes off to a different ASP to do some processing. The problem is that
I need to take one piece of data from the middle form with me. The
middle frame has a textfield which contains a number I need to take
with me.

I'm assuming in the ASP I go off to when the button is clicked I can
only get the data from the form the request has come from (using
request.form("variablename")) and there is no way to get data from one
of the other frames on the page?

So what I tried to do is go to a client-side function within the
bottom frame when a button is pressed. This function will get the
value from the middle frame and store it in a hidden field on the
bottom frame. This is the bit I can't figure out how to do!!!! The
function call works but my attempt at getting the data out of the
other frame fails miserably! I'm trying using

parent.frames["rundetails"].document.form1.id

id is the name of the variable I need and form1 is the name of my form
within the rundetails frame.

I'm using VBScript to do this.

Where am I going wrong??

Yours hopefully!
Kathryn.

Jul 19 '05 #2

P: n/a
KP

Thank you for your response. The data got into the middle frame from a
database call. Each row returned from the database has its unique key
attached to it and when the user selects the row they want to, for
example, edit the contents of it is this key I want to pass to the other
ASP.

Thinking about it, with your suggestion, I could put an event on the
selection of the record and store it in the session at that point. This
could then be accessed in the other ASP.

I'll give that a go, thanks for your idea!

It would be nice, however, to be able to access the data in the other
frame without having to do this as there may come a time when I want to
get more than one piece of data and don't really want to clutter up the
session with loads of data. So, if anyone knows how to do this then that
would be great!

Thanks again.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

P: n/a
-----Original Message-----
I hope you can help as this is driving me crazy!

I have an asp which has 3 frames on it as follows:

<FRAMESET rows="50%,*,10%">
<FRAME src="rundetailstop.asp" name="rundetailstop" scrolling="no"> <FRAME src="rundetails.asp" name="rundetails" scrolling="auto"> <FRAME src="rundetailsbottom.asp" name="rundetailsbottom"scrolling="no">
</FRAMESET>

The top frame(rundetailstop) is the heading, the middle
frame(rundetails) has the data within a form and the bottomframe(rundetailsbottom) has some buttons on it within a form.
When a button is clicked in the bottom frame it submits the form andgoes off to a different ASP to do some processing. The problem is thatI need to take one piece of data from the middle form with me. Themiddle frame has a textfield which contains a number I need to takewith me.

I'm assuming in the ASP I go off to when the button is clicked I canonly get the data from the form the request has come from (usingrequest.form("variablename")) and there is no way to get data from oneof the other frames on the page?

So what I tried to do is go to a client-side function within thebottom frame when a button is pressed. This function will get thevalue from the middle frame and store it in a hidden field on thebottom frame. This is the bit I can't figure out how to do!!!! Thefunction call works but my attempt at getting the data out of theother frame fails miserably! I'm trying using

parent.frames["rundetails"].document.form1.id

id is the name of the variable I need and form1 is the name of my formwithin the rundetails frame.

I'm using VBScript to do this.

Where am I going wrong??

Yours hopefully!
Kathryn.
.


I agree with "Tom B", that if you can do it from server-
side script that is the better choice. However, if you
still need the client-side, the following javascript works
for me:

Id = top.document.frames('rundetails').Form1.Id.value;

this will put the data in the variable "Id", from which
you can do whatever with it. Remember that Javascript is
case sensitive though.

Good Luck
Jul 19 '05 #4

P: n/a
KP

Thanks for your help. Unfortunately it seems I can't do this server-side
no matter how I try so I'm going to have to use client-side.

Thanks for your javascript, I'm using VBScript so do you happen to know
what the equivalent would be in VBScript?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.