Hello i have got a AJAX submit button using the following code.

<?php
   echo $ajax->submit('Submit Comment', array('url'=>'/Comments/add',
         'id'=>'comment-button',
'loading'=>'disableSubmit(\'comment-button\');',

'complete'=>'enableSubmit(\'comment-button\');clearTextArea(\'comment_text\');'));
   //echo $form->End('Submit Comment');
   ?>

The following is the code generated by the above submit function. but the
submit remains disabled on firefox though it works perfectly well on IE. Any
ideas on why this would happen are appreciated.


<div class="submit"><input type="submit" id="comment-button"
complete="enableSubmit('comment-button');clearTextArea('comment_text');"
value="Submit Comment" onclick="event.returnValue = false; return
false;" /></div><script type="text/javascript">
//<![CDATA[
Event.observe("comment-button", 'click', function(event) { new
Ajax.Request('/Comments/add', {asynchronous:true, evalScripts:true,
onComplete:function(request, json)
{enableSubmit('comment-button');clearTextArea('comment_text');},
onLoading:function(request) {disableSubmit('comment-button');},
parameters:Form.serialize(Event.element(event).form)}) }, false);
//]]>
</script>


Thanks in Advance.
-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to