[TYPO3-project-formidable] Submit form on enter keypress

JéŽrô™me Schneider typo3dev at ameos.com
Mon Aug 24 15:57:48 CEST 2009


Hi Gary,

You may do it like that:

<renderlet:TEXT name="submitonenter">
     <onKeyPress runat="client">
         <userobj>
             <js><![CDATA[

     oEvent = this.getContext().event[0];
     if(oEvent.keyCode == 13) {
         this.submitSearch();
     }
             ]]></js>
         </userobj>
     </onKeyPress>
</renderlet:TEXT>

It will work only with js enabled.

Best regards,
Jerome

Gary Wong a écrit :
> I have a couple of searchform fields. I would like the searchform to 
> submit when the user types something in either of the boxes and press 
> ENTER.  I  looked over the onkeypress code and while I can get what's 
> typed in the field I have no idea how I can capture the ENTER key 
> press.  I don't mind using client JS or AJAX.  Anyway have any ideas?
> 
> Thank you,
> Gary
> 
> 


More information about the TYPO3-project-formidable mailing list