You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Mooslechner Martin <ma...@siemens.at> on 2001/12/05 09:11:46 UTC

Action Events triggered by JavaScript

Hi,

I would like to have my Action Event to be triggered by JavaScript in such a
way that I use the JavaScript form.submit() method to achieve this. However,
if I use this method, I don't have any idea how to tell the Javascript
_which_ button should have been pressed (there is no
name="eventSubmit_doSomething" being sent with the form). But this is
essential to the Action Event Structure!

I also don't know how I could add some kind of extra <input> field with the
appropiate information (i.e. ...name="eventSubmit_doSomething").

Does anyone of you have any ideas on this?

thanks,
Martin

PS. What I'm trying to do is: I have 2 <select> boxes where the one is
dependent from the other; if I change one of them, the possible values in
the other <select> box should change. Now I want the first <select> box
trigger the Action Event, which then changes the context variable for the
second <select> box. Until now I have done this with a seperate button
beside the one <select> box, called "apply". This works. However, it would
be nice to handle this automatically, so the user doesn't have to press
"apply" everytime s/he changes the first <select> box...



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


RE: Action Events triggered by JavaScript

Posted by Gareth Coltman <ga...@majorband.co.uk>.
Just add the event as a name/value pair in the query data. The value is unimportant. IE:

setAction(myaction).addQueryData("eventSubmit_doSomething", 0)

> -----Original Message-----
> From: Mooslechner Martin [mailto:martin.mooslechner@siemens.at]
> Sent: Wednesday, December 05, 2001 08:12
> To: 'turbine-user@jakarta.apache.org'
> Subject: Action Events triggered by JavaScript
> 
> 
> Hi,
> 
> I would like to have my Action Event to be triggered by 
> JavaScript in such a
> way that I use the JavaScript form.submit() method to achieve 
> this. However,
> if I use this method, I don't have any idea how to tell the Javascript
> _which_ button should have been pressed (there is no
> name="eventSubmit_doSomething" being sent with the form). But this is
> essential to the Action Event Structure!
> 
> I also don't know how I could add some kind of extra <input> 
> field with the
> appropiate information (i.e. ...name="eventSubmit_doSomething").
> 
> Does anyone of you have any ideas on this?
> 
> thanks,
> Martin
> 
> PS. What I'm trying to do is: I have 2 <select> boxes where the one is
> dependent from the other; if I change one of them, the 
> possible values in
> the other <select> box should change. Now I want the first 
> <select> box
> trigger the Action Event, which then changes the context 
> variable for the
> second <select> box. Until now I have done this with a seperate button
> beside the one <select> box, called "apply". This works. 
> However, it would
> be nice to handle this automatically, so the user doesn't 
> have to press
> "apply" everytime s/he changes the first <select> box...
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



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