找了好久,怕網頁不見,乾脆就先記錄下來囉!!
原網址:http://www.mail-archive.com/struts-user@jakarta.apache.org/msg69201.html
Re: <html:errors> tag in javascript alert
Martin Fekete
Thu, 12 Jun 2003 23:29:54 -0700
try this ...
errors.header =alert(
errors.prefix ="
errors.suffix ="+ "\\n" +
errors.footer ="");\n
...
<script>
function load() {
<html:errors>
}
</script>
...
<body onload="load()">
...
it should work but it won't because of
http://issues.apache.org/bugzilla/show_bug.cgi?id=17418
so you need to hack org.apache.struts.taglib.html.ErrorsTag
Feky
P.S. 感謝涼鳥學長的幫忙!!
2 則留言:
謝謝分享這個好方法.我改成了
errors.header=< script language="javascript" >
errors.footer =< / script >
errors.invalid=alert("{0} is not valid");
一樣有用喔!!
感謝您所提的意見!
互相切磋的感覺真好~
互相學習!!!
張貼留言