You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Todd Pierce <To...@hubbub.com.au> on 2002/05/22 06:06:19 UTC

Form submission using html:link

Has anyone had any success submitting forms using <html:link> with the
client-side form validation (packaged with 1.1b1)?

My main problem is this:

The field validation function is run from an onSubmit event declared in an
attribute of the <html:form> tag. OnSubmit really means a press of a submit
button, and not any form submission (e.g. document.form.submit() does not
fire off an onSubmit event). here's an example:

This works:
<html:form action="registerJob.do" onsubmit="return
validateRegisterJob(this)">
	...
	<html:submit value="Submit" onClick="bCancel=false" />
</html:form>

This doesn't:
<html:form action="registerJob.do" onsubmit="return
validateRegisterJob(this)">
	...
	<html:link href="javascript: bCancel=false;
document.forms[0].submit()" />
</html:form>

Any suggestions???

There's a secondary problem too. How can I gain access to the form name so I
can use it in javascript?

Thanks,

Todd 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>