Find us on facebook

Jul 18, 2014

Javascript Submit Form

<?php
             
echo '<a href="javascript: submitform()">Next</a>'

 ?>
<script type="text/javascript">
function submitform()
{
    document.forms["rep-data-models-form"].submit();
}
</script>

Submit form to specific action
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'rep-data-models-form',
'action' => Yii::app()->createUrl('reports/repColumns/create'),
'enableAjaxValidation'=>true,
'htmlOptions' => array(
                'enctype' => 'multipart/form-data',
            ),
));

?>

No comments:

Post a Comment