[wp-hackers] Idea for comments.php

Roland Haeder webmaster at mxchange.org
Mon Oct 2 22:57:22 GMT 2006

On Tuesday, 3. October 2006 00:52, Austin Matzko wrote:
> On 10/2/06, Roland Haeder <webmaster at mxchange.org> wrote:
> > Some people (may) like to add some JavaScript pre-checking (e.g. useful
> > for AJAX) to their plugins (contact forms, wherever the "blog reader" has
> > to interact with the blog).
> >
> > Currently you have to "hack" comments.php a little but what about a
> > filter-based solution? So plugin coders can very easy add their
> > JavaScript to a onsubmit and onreset "stub".
> Why not put the JavaScript in the header, via the wp_head action hook?
The reason for this is that some want to pre-check via this code:

<!-- Somewhere in the a-tag: //-->
onSubmit="return submitHook();" onReset="return resetHook();"

Now we "just" need to add something like this inside of the <form></form> 
comtainer and everyone is happy:

<?php wp_javascript(); ?>

Inside wp_javascript() we must check if the user wants to submit a comment or 
something else.

Just an idea. :-)

(GNU) PGP ID: 0x8C8859B9


More information about the wp-hackers mailing list