Hey Adam thanks. So basically one of the things I did was when I am on page x I validate using client side JS validation either written myself or html:javascript doesn't really metter but both of those two methods pop up an alert and doesn't actually put it right in the page like html:errors does. But then yeah it actually works I still have target there and it opens a new window only when validation succeded thats fine is there any way to make javascript display html:errors like right in page and not in a pop up I looked at html:errors it doesn't have an id or styleId attribute which means I can't do my document.getElementByID('id').innerHTML = 'some error'. So what do you recommend. By the way thanks for your input.
Pavel On Nov 19, 2007 5:38 PM, Adam Gordon <[EMAIL PROTECTED]> wrote: > 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] > > -- Pavel Sapozhnikov xFact, Inc [EMAIL PROTECTED]