Re: [S2] onsubmit in tag

2007-06-26 Thread Vincent Lin
Hi Dave, Thank you. You are right. There is an error in my validateFields() function. It works now. The "return true" in onsubmit has nothing to do with my problem. Vincent On 6/26/07, Dave Newton <[EMAIL PROTECTED]> wrote: --- Vincent Lin <[EMAIL PROTECTED]> wrote: > If you try it in a plain

Re: [S2] onsubmit in tag

2007-06-26 Thread Dave Newton
--- Vincent Lin <[EMAIL PROTECTED]> wrote: > If you try it in a plain html form, you will know > the difference. That's really useful to use > onsubmit="return (validateFields())" in form > tag, Um... Yeah, I understand that. What I'm saying is: onsubmit="return validateFields(); return true;"

Re: [S2] onsubmit in tag

2007-06-26 Thread Vincent Lin
If you try it in a plain html form, you will know the difference. That's really useful to use onsubmit="return (validateFields())" in form tag, and validate all fields in validateFields() function (If you are not using validators.). Return true in validateFields() if all validations are passed. Re

Re: [S2] onsubmit in tag

2007-06-26 Thread Dave Newton
--- Vincent Lin <[EMAIL PROTECTED]> wrote: > For example, onsubmit="return (validateFields())" is > specified in html 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'

Re: [S2] onsubmit in tag

2007-06-26 Thread Vincent Lin
I usually use onsubmit in form tag to do javascript validation. For example, onsubmit="return (validateFields())" is specified in html 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 'retur

Re: [S2] onsubmit in tag

2007-06-26 Thread yitzle
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 ons

Re: [S2] onsubmit in tag

2007-06-26 Thread Dave Newton
--- 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 reall

[S2] onsubmit in tag

2007-06-26 Thread Vincent Lin
Hi! I wrote in my JSP, but struts 2 rendered the following html: Why it renders onsubmit="return (validateFields()); return true;" instead of onsubmit="return (validateFields())" ? Can I make renders onsubmit="return (validateFields())" only? Thanks!