I am using the validator plugin, specifying all my validation in validation.xml.

I want to use the automatic javascript generation feature to add client-side validation.

My form page is basically like this:

. . .

<html:javascript formName="fooForm"/>

. . .

<form action="${myAction}" onsubmit="return validateFooForm(this)">

When the page is rendered, I can view source and see the javascript function is seemingly properly rendered, and the function name matches up with that called in the onsubmit attribute, yet if I submit a blank form, I don't get any alerts -- the form submits.

I'm not sure how to debug this since the javascript is generated dynamically; I suppose I could edit validator-rules.xml to put alerts in?

Anything I am obviously doing wrong or forgetting here? I'm not very good with javascript, but I was hoping to avoid pasting the function because it's quite lengthy.

I tried moving the html:javascript tag around to different places -- at the top of the page, just above the form, just inside the form, doesn't seem to make any difference. I do have other (non-generated) javascript functions working.

If you don't see anything wrong so far I'll paste a snip of the page source from the browser (Mozilla 1.7).


Erik


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



Reply via email to