After validation hasnoerror form not submit in yii

Hi,

I am Done Aftervalidation No Validation error mean Disable button.

My coding,

<?php


            $form = $this->beginWidget('CActiveForm', array(


                'id' => 'question-form',


                // Please note: When you enable ajax validation, make sure the corresponding


                // controller action is handling ajax validation correctly.


                // There is a call to performAjaxValidation() commented in generated controller code.


                // See class documentation of CActiveForm for details on this.


                'enableAjaxValidation' => true,


                'enableClientValidation' => false,


                'clientOptions' => array(


                    'validateOnSubmit' => true,


                    'validateOnChange' => false,                       


                    'afterValidate' => 'js:buttondisable',





                ),


                


                


            ));


            ?>





function buttondisable(form,data,hasError)


{

if(!hasError){

          document.getElementById('questionnew').disabled = true;   


          return true;





        }

}

Its working only button disabled and form not submitted.once i return true before the disable button function mean form submitted.i want both button disable and form submit too.

Try changing

document.getElementById(‘questionnew’).disabled = true;

to

document.getElementById(‘questionnew’).setAttribute(“disabled”,“disabled”);

Hey man a quick question, why not JQuery for working DOM structure… Try and tell us bro…