Yii Framework Forum: AJAX Submit Not Working for CActiveForm - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

AJAX Submit Not Working for CActiveForm Rate Topic: -----

#1 User is offline   queej 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 04-February 10

Posted 18 April 2010 - 08:46 AM

Is anyone else having a problem with a CActiveForm submitting normally, rather than via AJAX?

All the other great features of the form are working, using AJAX calls. The submit, however, is not. I am using CHtml::submitButton(). In the "Help Test CActiveForm" thread Quiang suggests clearing assets and says that the CHtml::ajaxSubmitButton() should not be necessary, but I am stuck. (I've tried the latter, which submits via ajax, but circumvents the CActiveForm functionality.

Thanks for any assistance. I posted my form on the last page of the "Help Test CActiveForm" thread.
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 18 April 2010 - 11:49 AM

Yeah, actually i miss that feature too :). I tried a lot but ended up using my custom javascript again, instead of CActiveForm. To be honest i'm not sure, if this can be integrated with the current implementation.

Main problem i see, is that CActiveForm always expects a validation result as response. But the situation is different when submitting. There can be two conditions:

1. Validation was unsuccessful. So validation result must be sent to the client, as usual.

2. Validation was successful. We can save the form data, but what should be sent back to the client? And what should the client do then?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users