It can be even simpler than Walter's version, and I'm not aware of any
issues with `click` not bubbling:
$('theForm').observe('click', function(event) {
// Find out if it was a submit button that was clicked
var button = event.findElement('input[type=submit]');
if (button) {
// Yes, grab its value and do something with it.
// In this example, we'll populate a hidden field
// with the name "q":
this.down('input[name=q]').value = button.value;
}
});
Here's a live example: http://jsbin.com/ukifo3
Works with IE6, IE7, Firefox, Opera, Chrome...
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Dec 22, 9:51 pm, kstubs <[email protected]> wrote:
> OK, just observing click event for the submit button is working fine.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.