<div class="panel-body panel-body-nopadding">
<div class="wizard-tabs">
<ul class="wizard-steps">
<li class="active">
<a href="#profile" data-toggle="tab" class="text-center">
<span class="badge hidden-xs">1</span>
PERSONAL INFORMATION
</a>
</li>
<li>
<a href="#office" id="office-info" data-toggle="tab" class="text-center">
<span class="badge hidden-xs">2</span>
OFFICE INFORMATION
</a>
</li>
<li>
<a href="#informer" id="informer-info" data-toggle="tab" class="text-center">
<span class="badge hidden-xs">3</span>
INFORMER DETAILS
</a>
</li>
<li>
<a href="#partner" id="partner-info" data-toggle="tab" class="text-center">
<span class="badge hidden-xs">4</span>
PARTNER DETAILS
</a>
</li>
</ul>
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'patient-registration-form',
'method'=>'POST',
'enableClientValidation' => True,
'enableAjaxValidation' => FALSE,
'clientOptions' => array(
'validateOnSubmit' => true,
'beforeValidate' => 'js:function(form, data, hasError) {
var interest = $("ul.wizard-steps").find("li.active >a").attr("href");
$("#tabvalue").val(interest);
console.log(interest);
if(hasError) {
console.log("rosme red");
for(var i in data) $("#"+i).parent().addClass("has-error");
return false;
}
else {
$("#office-info").trigger("click");
console.log("rosme greennnn");
}
}',
),
'htmlOptions' => array(
'class' => 'form-horizontal form-bordered form-row-stripped',
),
));
?> </div>
<div class="tab-content">
<div id="profile" class="tab-pane active">
<div class="row">
<input id='tabvalue' type='text' name="tabname" >
<div class="form-group col-md-4">
<label class="control-label" for="w1-username">Username</label>
<div>
<?php echo $form->textField($model, 'f_name', array('size' => 60,'class'=>"form-control input-sm", 'maxlength' => 255)); ?>
<?php echo $form->error($model, 'f_name'); ?>
</div>
</div>
<div class="form-group col-md-4">
<label class="control-label" for="w1-password">Gender</label>
<div>
<?php echo $form->dropDownList($model, 'gender', array('' => '---please select---', 'Groom' => 'Groom', 'Bride' => 'Bride')); ?>
<?php echo $form->error($model, 'gender'); ?>
</div>
</div>
</div>
</div>
<div id="profile" class="tab-pane">
<div class="row">
<div class="form-group col-md-6 col-sm-6 col-xs-12">
<label class="control-label">Multi-Value Select</label>
<select data-plugin-selectTwo class="form-control populate placeholder" data-plugin-options='{ "placeholder": "Select a State", "allowClear": true }'>
<optgroup label="Alaskan/Hawaiian Time Zone">
<option value="AK">Alaska</option>
<option value="HI">Hawaii</option>
</optgroup>
</select>
</div>
</div>
</div>
<div id="office" class="tab-pane">
<div class="form-group">
<label class="col-sm-4 control-label" for="w1-email">Email</label>
<div class="col-sm-8">
<?php echo $form->textField($model, 'contact_num', array('size' => 60,'class'=>"form-control input-sm", 'maxlength' => 255)); ?>
<?php echo $form->error($model, 'contact_num'); ?>
</div>
</div>
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<div class="checkbox-custom">
<label for="w1-terms">I agree to the terms of service</label>
</div>
</div>
</div>
</div>
<div id="partner" class="tab-pane">
<div class="form-group">
<label class="col-sm-4 control-label" for="w1-email">Email</label>
<div class="col-sm-8">
<?php echo $form->textField($model, 'contact_num', array('size' => 60,'class'=>"form-control input-sm", 'maxlength' => 255)); ?>
<?php echo $form->error($model, 'contact_num'); ?>
</div>
</div>
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<div class="checkbox-custom">
<label for="w1-terms">I agree to the terms of service</label>
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<ul class="pager">
<li class="previous disabled">
<a><i class="fa fa-angle-left"></i> Previous</a>
</li>
<li class="finish hidden pull-right">
<a>Finish</a>
</li>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array("class" => "btn btn-success","id"=>"submit-button","style"=>"margin-top:58px;float:right;")); ?>
</div>
</ul>
</div>
<?php $this->endWidget(); ?>
我需要提交带有yii验证的选项卡式表单,即验证每个选项卡,表单 领域内容。 我一直坚持下去。 是否可以启用Ajax验证/客户端验证 谁能帮我吗.. 预先感谢
例如,如果错误在其他选项卡上,则应将选项卡更改为点击提交时出现错误的选项卡。 这是我的查看文件,供您进一步说明。