I usually use onsubmit in form tag to do javascript validation.

For example, onsubmit="return (validateFields())" is specified in html
<form> tag.
If the javascript function validateFields() return true, the form will
submit, otherwise it won't.

It works fine in struts 1.
But struts2 always add 'return true' in onsubmit event.
That causes validateFields() useless.


On 6/26/07, yitzle <[EMAIL PROTECTED]> wrote:

Um... Firstly, it does the same thing.
I think if you move the code to the submit button it renders it as
expected.

On 6/26/07, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- Vincent Lin <[EMAIL PROTECTED]> wrote:
> > Why it renders onsubmit="return (validateFields());
> > return true;"
> > instead of onsubmit="return (validateFields())" ?
> > Can I make renders  onsubmit="return
> > (validateFields())" only?
>
> Probably that's what's in the template. I'm not sure
> that it really matters, though.
>
> d.
>
>
>
>
>
____________________________________________________________________________________
> Building a website is a piece of cake. Yahoo! Small Business gives you
all the tools to get online.
> http://smallbusiness.yahoo.com/webhosting
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


Reply via email to