MyBB Community Forums

Full Version: Run JS script after quick reply
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to run some JS script just after the quick reply is succesully sent, I have tried (after $headerinclude):
<script type="text/javascript">
Event.observe($('quick_reply_submit'), 'click', foo('{$var1}', '{$va32}', '{$var3}', '{$var4}', '{$var5}'));
</script>

Then:
function foo(var1, var2, var3, var4, var5)
{
	alert("An error occurred when rating the post.");
	return false;
}

But nothing happens really, at all. Any help really appreciated.
Any help appreciated.
Have you tried an onclick() on the quickreply button?


post #5,000
Read:
http://www.prototypejs.org/api/event/observe

You probably want to register form submission, not button click.
(2012-10-08, 06:31 AM)Paul H. Wrote: [ -> ]Have you tried an onclick() on the quickreply button?

Yes, but doesn't work.

(2012-10-08, 07:30 PM)Pirata Nervo Wrote: [ -> ]Read:
http://www.prototypejs.org/api/event/observe

You probably want to register form submission, not button click.

Thanks and yes, probably will stick to form submission.