You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Joy <jo...@yahoo.com> on 2006/09/16 19:35:41 UTC

Submit button with listener and onclick event

Hi All,

Question about forms...I would like to have a button
that has an onClick 
event that calls a javascript function and I would
like to also set up a 
tapestry listener for the same button, so when the
user pushes the 
button first the onClick function is called, next the
Tapestry listener 
is invoked. Is such a thing possible?

Thanks in advance,
Josh

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


Re: Submit button with listener and onclick event

Posted by Jesse Kuhnert <jk...@gmail.com>.
Sure. dojo.event.connect("before", dojo.byId("your button id"), "onclick",
function(event){
   // do stuff
});

On 9/16/06, Josh Joy <jo...@yahoo.com> wrote:
>
> Hi All,
>
> Question about forms...I would like to have a button
> that has an onClick
> event that calls a javascript function and I would
> like to also set up a
> tapestry listener for the same button, so when the
> user pushes the
> button first the onClick function is called, next the
> Tapestry listener
> is invoked. Is such a thing possible?
>
> Thanks in advance,
> Josh
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Re: Submit button with listener and onclick event

Posted by "suraj.ratnaparkhi" <su...@yahoo.com>.
There is an another alternative for what you are trying to do. You can assign
js function for *button onclick even*t and for* tapestry listener* you can
add it in *form* tag as *listener=ognl:listeners.listener-name*. For this
you should add *document.getElementById("formId").submit()* in your js
function.

This will work for sure. I have tried and tested this.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submit-button-with-listener-and-onclick-event-tp2397406p5658526.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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