You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dirk Behrendt <sc...@web.de> on 2003/07/31 21:09:41 UTC
AW: Show validation errors in a dialog
I want to be a bit more concret:
With JavaScript you can create a window, after klicking a button.
JavaScript Code:
<form>
<p><input type=" button " value=" Hello Button ... " onClick="
alert('Hello'); "> </p>
</form>
I want, that such a window appears, when errors occur. So I have to put
code in the <logic:messagesPresent> tag.
<logic:messagesPresent>
<bean:message key="errors.header"/>
<ul>
<html:messages id="error">
<li><bean:write name="error"/></li>
</html:messages>
some JavaScript for a window
<alert('Don\'t forget to press the back button to return!')">
</ul><hr>
</logic:messagesPresent>
Dirk
-----Ursprüngliche Nachricht-----
Von: Dirk Behrendt [mailto:schnoerk@web.de]
Gesendet: Donnerstag, 31. Juli 2003 19:21
An: 'struts-user@jakarta.apache.org'
Betreff: Show validation errors in an dialog
Hello!
What is necessary to show errors from validation not in a JSP , but in a
dialog?
Dirk
Re: AW: Show validation errors in a dialog
Posted by Rob Leland <rl...@apache.org>.
If you are talking about presenting the server side validation errors
on the client I believe you could do it on the
'onload' event handler in the <BODY > tag.
If you want the client side validation performed by Javascript
to display errors then look at the struts-validator
example.
Dirk Behrendt wrote:
> I want to be a bit more concret:
>
> With JavaScript you can create a window, after klicking a button.
>
> JavaScript Code:
>
> <form>
>
> <p><input type=" button " value=" Hello Button ... " onClick="
> alert('Hello'); "> </p>
>
> </form>
>
> I want, that such a window appears, when errors occur. So I have to
> put code in the <logic:messagesPresent> tag.
>
> <logic:messagesPresent>
>
> <bean:message key="errors.header"/>
>
> <ul>
>
> <html:messages id="error">
>
> <li><bean:write name="error"/></li>
>
> </html:messages>
>
> ……some JavaScript for a window
>
> <alert('Don\'t forget to press the back button to return!')">
>
> </ul><hr>
>
> </logic:messagesPresent>
>
> Dirk
>
> -----Ursprüngliche Nachricht-----
> *Von:* Dirk Behrendt [mailto:schnoerk@web.de]
> *Gesendet:* Donnerstag, 31. Juli 2003 19:21
> *An:* 'struts-user@jakarta.apache.org'
> *Betreff:* Show validation errors in an dialog
>
> Hello!
>
> What is necessary to show errors from validation not in a JSP , but in
> a dialog?
>
> Dirk
>
--
-----
Rob Leland (703-525-3580)
Choose a job you love, and you will never have to work a day of your life.
-Confucius.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org