You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Rodrigo Oliveira <ro...@icorp.com.br> on 2004/05/28 21:32:48 UTC

ValidatorTool

Hi people, 
How a can to show validator errors in page? My .vm file is writing JavaScript validation code, but when i submit the form don´t show any message. The validation is being executed correctly.

The code from my .vm file is:

=============================================================================
<HTML>
<HEAD>
<TITLE>login</TITLE>
$validator.getDynamicJavascript()
</HEAD>
<BODY>
<form name="operadorForm" method="post" action="./login.do" onsubmit="return validateOperadorForm(this)">
 <TABLE border="0">
  <TBODY>
   <TR>
    <TH>login</TH>
    <TD><input type="text" name="login" value="$!operadorForm.login"></TD>
   </TR>
   <TR>
    <TH>senha</TH>
    <TD><input type="text" name="senha"></TD>
   </TR>
   <TR>
    <TD><input type="submit" name="submit" value="Enviar"></TD>
    <TD><input type="reset" name="reset" value="Limpar"></TD>
   </TR>
  </TBODY>
 </TABLE>
</form>

#if ($messages.exist("error"))
    <ul>
    #foreach ($er in $messages.get("error") )
        <li>$er</li>
        asdfasdf
    #end
    </ul>
#end
</BODY>
</HTML>
=============================================================================


Help-me please!!! :)


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rodrigo Oliveira
[ Programador ]

Icorp - Agência de Internet
Criando uma internet de resultados
:: www.icorp.com.br ::

* rodrigo@icorp.com.br
( 81 3427.1359

Re: ValidatorTool

Posted by "Marino A. Jonsson" <ma...@hotmail.com>.
Hi Rodrigo,

Now, the problem is that the static part of the javascript is missing -
either you have to put the static javascript in a .js file and reference it
in the .vm page (as you would in a plain .html file) - or use
$validator.getJavascript() to generate both the static and dynamic parts in
one go.

cheers,
Marin�

"Rodrigo Oliveira" <ro...@icorp.com.br> wrote in message
news:01d101c444ea$8fe397f0$1b00000a@rodrigo...
Hi people,
How a can to show validator errors in page? My .vm file is writing
JavaScript validation code, but when i submit the form don�t show any
message. The validation is being executed correctly.

The code from my .vm file is:

============================================================================
=
<HTML>
<HEAD>
<TITLE>login</TITLE>
$validator.getDynamicJavascript()
</HEAD>
<BODY>
<form name="operadorForm" method="post" action="./login.do" onsubmit="return
validateOperadorForm(this)">
 <TABLE border="0">
  <TBODY>
   <TR>
    <TH>login</TH>
    <TD><input type="text" name="login" value="$!operadorForm.login"></TD>
   </TR>
   <TR>
    <TH>senha</TH>
    <TD><input type="text" name="senha"></TD>
   </TR>
   <TR>
    <TD><input type="submit" name="submit" value="Enviar"></TD>
    <TD><input type="reset" name="reset" value="Limpar"></TD>
   </TR>
  </TBODY>
 </TABLE>
</form>

#if ($messages.exist("error"))
    <ul>
    #foreach ($er in $messages.get("error") )
        <li>$er</li>
        asdfasdf
    #end
    </ul>
#end
</BODY>
</HTML>
============================================================================
=


Help-me please!!! :)


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .
Rodrigo Oliveira
[ Programador ]

Icorp - Ag�ncia de Internet
Criando uma internet de resultados
:: www.icorp.com.br ::

* rodrigo@icorp.com.br
( 81 3427.1359




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org