[pmwiki-users] Validating forms in pmwiki
design5 at softflow.co.uk
Fri Jul 3 09:13:27 CDT 2009
Friday, July 3, 2009, 3:04:13 PM, Hans wrote:
> the 'Enter' key pressed as being interpreted as a form submit.
> event hook needs to be added to text and textarea input fields.
i think this should work:
add to config.php:
#prevent hitting 'Enter' from submitting a form
key = window.event.keyCode; //IE
key = e.which; //firefox
return (key != 13);
"<textarea \$InputFormArgs onKeyPress='return disableEnterKey(event)'>\$InputFormContent</textarea>";
"<input type='text' \$InputFormArgs onKeyPress='return disableEnterKey(event)' />";
More information about the pmwiki-users