hreinart
asked on
need to copy a value from 1 field to another in a frameset (web)
hi,
i have a web application with 2 frames.
both frames contains a form with one filed where you can eneter a number.
in frame 1 the number is entered and the user presses a button.
then a text is displayed.
if the text is ok the user enters the same number in the form of frame 2.
question:
how can i make it that when the number is enteed in frame 1 and the button is pressed that this number is displayed as "default" in frame 2.
the user would not need to enter it again.
hint:
the button in frame 1 does just submit the form via java-script: document.forms[0].submit()
i have a web application with 2 frames.
both frames contains a form with one filed where you can eneter a number.
in frame 1 the number is entered and the user presses a button.
then a text is displayed.
if the text is ok the user enters the same number in the form of frame 2.
question:
how can i make it that when the number is enteed in frame 1 and the button is pressed that this number is displayed as "default" in frame 2.
the user would not need to enter it again.
hint:
the button in frame 1 does just submit the form via java-script: document.forms[0].submit()
ASKER
hi,
it doesn't work and i get no error message.
this code is in the button of frame1 to submit it:
var srcVal = document.forms[0].searchst ring.value ;
parent.frame3.document.for ms[0].buch nummer.val ue = srcVal;
document.forms[0].submit()
regarding the amount of frames i was wrong; there are 3 frames.
any idea?
it doesn't work and i get no error message.
this code is in the button of frame1 to submit it:
var srcVal = document.forms[0].searchst
parent.frame3.document.for
document.forms[0].submit()
regarding the amount of frames i was wrong; there are 3 frames.
any idea?
Replace the fieldname with your orginial field name
parent.frames["frame2"].do cument.all .<yourfiel dname>.val ue=parent. frames["fr ame1"].doc ument.all. <yourfield name>.valu e
Partha
parent.frames["frame2"].do
Partha
ASKER
hi,
looks interesting....
this code should
be copied in the button of the 1st frame?
..or is this the value of the field in frame2 ?
the word frame2 and frame1 need to be exchanged with the real frame names?
thanks
hreinart
looks interesting....
this code should
be copied in the button of the 1st frame?
..or is this the value of the field in frame2 ?
the word frame2 and frame1 need to be exchanged with the real frame names?
thanks
hreinart
ASKER
hi,
it look now like this and doesn't work:
parent.frames["rueckgabe-u nten"].doc ument.all. buchnummer .value=par ent.frames ["suche-ob en"].docum ent.all.Se archString .value;
document.forms[0].submit()
rueckgabe-unten = frame2 with filed buchsuche
suche-oben = frame1 with field searchstring
it look now like this and doesn't work:
parent.frames["rueckgabe-u
document.forms[0].submit()
rueckgabe-unten = frame2 with filed buchsuche
suche-oben = frame1 with field searchstring
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
answered it myself, please delete and refund points
ASKER
hi,
what do you mean by other obligations here?
i answered the question myself.
isn't ok to delete and refund?
hreinart
what do you mean by other obligations here?
i answered the question myself.
isn't ok to delete and refund?
hreinart
If so, then if your submit button is written in JavaScript, then you can overwrite the field in the form in frame 2, something like the following:
var srcVal = document.forms[0].fieldnam
parent.frame2.document.for
I'm assuming some things here about the names of your fields, frames, and how many forms you have on your pages, but this syntax should to the trick.