You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa" <da...@xs4all.nl> on 2004/01/30 21:33:13 UTC

vs document.getElementById('tbodyForm').submit()

Hi,

This is a question re. submitting a form via a js call or directly via a 
submit button (either in or outside of the form)

The form def.
<form jwcid="@Form" id="tbodyForm" listener="ognl:listeners.formEditSubmit">

The button def (could be anywhere on the page)
<button onClick="document.getElementById('tbodyForm').submit();">Store</button>

The following should be contained within the form tags
.html
<input type="submit" value="Remove" jwcid="editSubmit" /><br />
.page
<component id="editSubmit" type="Submit">
  <binding name="listener" expression="listeners.formEditSubmit"/>
  <static-binding name="label" value="Store modified data/ full submit"/>
</component>


Shouldn't the two methods be equal in dealing with the submit?
The reason for using the <button> variant lies in the fact that I do not 
have a good location on my page (in the middle of a table) for the <input> 
version with a type=submit.

TIA
Fermin DCG


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


Re: vs document.getElementById('tbodyForm').submit()

Posted by Paul Ferraro <pm...@columbia.edu>.
In my experience, when explicitly submitting a form via javascript, the 
onsubmit handler of the form is not triggered.  This probably varies 
depending on browser.

Paul Ferraro

F. Da Costa wrote:

> Hi,
>
> This is a question re. submitting a form via a js call or directly via 
> a submit button (either in or outside of the form)
>
> The form def.
> <form jwcid="@Form" id="tbodyForm" 
> listener="ognl:listeners.formEditSubmit">
>
> The button def (could be anywhere on the page)
> <button 
> onClick="document.getElementById('tbodyForm').submit();">Store</button>
>
> The following should be contained within the form tags
> .html
> <input type="submit" value="Remove" jwcid="editSubmit" /><br />
> .page
> <component id="editSubmit" type="Submit">
>  <binding name="listener" expression="listeners.formEditSubmit"/>
>  <static-binding name="label" value="Store modified data/ full submit"/>
> </component>
>
>
> Shouldn't the two methods be equal in dealing with the submit?
> The reason for using the <button> variant lies in the fact that I do 
> not have a good location on my page (in the middle of a table) for the 
> <input> version with a type=submit.
>
> TIA
> Fermin DCG
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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