It could actually be both.  I assume you are using both client and
server side JavaScript validation (at the very least you should be doing
server side since HTML pages can be manipulated).

So, assuming you are doing both, you need the page you submitted the
data on to go somewhere because you want to chain the action, i.e., you
want to have another window open.  One way to do this is to have the
main page come back and set a request attribute that indicates you are
to open the pop-up window.  In J/S land in your JSP (inside a <script>
element at the bottom of the page you can have code that checks for this
parameter (using '${paramName}') and if it's present open the pop-up
window.

Word to the wise...if your popup window relies on elements existing in
the page (and it doesn't sound like it does) then you need to use some
sort of window.onload function (or replace window.onload with some type
of callback chain mechanism - I can provide you w/ a link to the one we
use) so that you can be sure that the page is fully loaded/rendered
before the script executes.

Hope that helps.

--adam
-----Original Message-----
From: Pavel Sapozhnikov [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 2:49 PM
To: Struts Users Mailing List
Subject: opening a new window if validated

Hi I have a question. I am not sure if this is a Struts question or an
HTML
question so here we go. I have a form on page x I submit the form
validation
failed it goes back to the page x which is fine but then if validated
true
it should open a new window with the stuff that should be there. So
again I
am not sure if this is Struts question or HTML question I tried doing
onsubmit="validateSomething()" and then that would do javascript
validation
but then it didn't display my html:errors. So any help would be really
appreciated. Thanks.


-- 
Pavel Sapozhnikov
xFact, Inc
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to