I didn't know how else to describe it. Here's the code: <? echo $ajax->form('addComment', 'post', array( 'model' => 'Comment', 'url' => array('controller' => 'comments', 'action' =>'add'), 'update' => 'pureGenius')); //echo $form->input('comment', array('rows' => '3')); ?>
<script type="javascript"> var flag = false; </script> <textarea name="data[Comment][comment]" onKeyDown="if(event.keyCode == 13 && flag) { submit(); } if(event.keyCode == 16) { flag = true; }" onKeyUp="if(event.keyCode == 16) { flag = false; }" style="width:100%; height:100px;" id="CommentComment" ></textarea> <? echo $form->end('Talk'); ?> So basically I want it when someone types Shift+Enter in the text box it submits the form. If I use the submit button, the form submits all ajaxy in the proper way. However if I use the Shift+Enter method, the form submits, but not in the good ajax way, it reloads the page. Is there a seperate submit call for an ajax form? Also, I find that its impossible to name a form. The 'addComment' doesn't work. Neither does putting it in the array options. Anyone else find this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---