Laurie is of course correct. However, the other way you can do this is
to have the script that you show here in the value attribute execute as
a result of the onLoad event. That way you would not need to pass the
information through with the request.
The flow of what happens in that case is basically:
(1) Some event on the page with formA occurs, either some Javascript
that opens a new window, or a form submission targeted to a new window
(2) The request is processed on the server and the page with formB is
rendered, but with no values set.
(3) The page with formB on it is returned to the client and shown in a
new window.
(4) Event onLoad fires executing the script which copies the values from
the parent to the child.
This is actually a fairly typical way of doing this, it's up to you
whether you prefer the more client-side approach of this or the more
server-side approach as Laurie suggests. I wouldn't say either is
drastically better than the other.
Frank
Laurie Harper wrote:
You're trying to mix JSP syntax, which is processed on the server before
the page is sent to the browser, with Javascript, which is processed by
the browser after the page is sent. You can't do that.
What you'll need to do is, when formA opens formB (presumably by
submitting an HTTP request), include the information you need from formA
as request parameters formB can then access during rendering.
L.
O. Oke wrote:
Help please!
BACKGROUND
==========
A parent window/form - formA opens up formB. In
formB, I am using logic:equal. In the value attribute
of logic:equal, I want to dynamically get the current
value of a field in formA - opener.
PART OF SOURCE CODE
===================
<logic:equal name="repBranch" property="country_id"
value=opener.forms[0].to_country.value>
PROBLEM
=======
None of the lines below (value attribute of
logic:equal) work:
value=opener.forms[0].to_country.value
value="opener.forms[0].to_country.value"
value='opener.forms[0].to_country.value'
value=javascript:opener.forms[0].to_country.value
value="javascript:opener.forms[0].to_country.value"
value='javascript:opener.forms[0].to_country.value'
The only time it works is when the value is hardcoded
i.e. value="UK"
I do not want to hard code the country name, because
it is not always UK.
Please tell me how to proceed...
Thank you.
O. Oke
___________________________________________________________ Yahoo!
Messenger - NEW crystal clear PC to PC calling worldwide with
voicemail http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]