これは私の作成ページです。
レート = 労働力 + 機械 + 材料 + サイトの諸経費 + 本社の諸経費 + 利益
送信ボタンをクリックする前に、上記の計算を行い、レート テキスト フィールドに入力します。これを行うためのキープレス(Windowsアプリケーションのような)のようなイベントはありますか?私は yii を初めて使用しますが、皆さんがこれを行うのを手伝ってくれると思います。
これは、Yii によって生成された私のフォームです。
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'trboq-form',
'enableAjaxValidation'=>false,
)); ?>
<?php
$projectWbs = Yii::app()->session['projectWbs'];
?>
<?php
$subBoqNo=Yii::app()->session['$subBoqNo'] ;
$subBoqDes=Yii::app()->session['subBoqDes'] ;
$mainBoqDes=Yii::app()->session['mainBoqDes'] ;
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<!-- Start of First table-->
<div class="form">
<div class="group" style="width:600px; padding-left:50px;margin-top:40px; margin-left:15px">
<fieldset>
<legend>General</legend>
<table>
<tr>
<th><?php echo $form->hiddenfield($model,'Project_Code'); ?></th>
<th><?php echo $form->hiddenfield($model,'Project_Code',array('size'=>20,'value'=>$projectWbs,'readonly'=>true)); ?></th>
<th><?php echo $form->error($model,'Project_Code'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Sub_BOQ_No'); ?></th>
<th><?php echo $form->textField($model,'Sub_BOQ_No',array('size'=>20,'value'=>$subBoqNo,'readonly'=>true)); ?></th>
<th><?php echo $form->error($model,'Sub_BOQ_No'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Sub_BOQ_Description'); ?></th>
<th><?php echo $form->textField($model,'Sub_BOQ_Description',array('size'=>60,'maxlength'=>150, 'value'=>$subBoqDes,'readonly'=>true)); ?> </th>
<th><?php echo $form->error($model,'Sub_BOQ_Description'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'BOQ_Item_Code'); ?></th>
<th><?php echo $form->textField($model,'BOQ_Item_Code',array('size'=>25,'maxlength'=>25)); ?></th>
<th><?php echo $form->error($model,'BOQ_Item_Code'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'BOQ_Item_Name'); ?></th>
<th><?php echo $form->textarea($model,'BOQ_Item_Name',array('rows'=>6, 'cols'=>40)); ?></th>
<th><?php echo $form->error($model,'BOQ_Item_Name'); ?></th>
</tr>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'BOQ_Description'); ?></th>
<th><?php echo $form->textarea($model,'BOQ_Description',array('rows'=>6, 'cols'=>40)); ?></th>
<th><?php echo $form->error($model,'BOQ_Description'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Unit_Code'); ?></th>
<th> <?php echo $form->dropdownlist($model,'Unit_Code',CHtml::listData(MaUnits::model()->findAll(),'Unit_Code','Unit_Code'),array('width'=> '25', 'empty'=>'please select')); ?></th>
<th><?php echo $form->error($model,'Unit_Code');?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Qty'); ?></th>
<th><?php echo $form->textField($model,'Qty'); ?></th>
<th><?php echo $form->error($model,'Qty'); ?></th>
</tr>
</table>
</fieldset>
</div>
</div>
<div class="form">
<div class="group" style="width:600px; padding-left:50px;margin-top:40px; margin-left:15px">
<fieldset>
<legend>Cost</legend>
<table>
<tr>
<th><?php echo $form->labelEx($model,'Labour'); ?></th>
<th><?php echo $form->textField($model,'Labour'); ?></th>
<th><?php echo $form->error($model,'Labour'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Machinery'); ?></th>
<th><?php echo $form->textField($model,'Machinery'); ?></th>
<th><?php echo $form->error($model,'Machinery'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Matirial'); ?></th>
<th><?php echo $form->textField($model,'Matirial'); ?></th>
<th><?php echo $form->error($model,'Matirial'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Side_over_head'); ?></th>
<th><?php echo $form->textField($model,'Side_over_head'); ?></th>
<th><?php echo $form->error($model,'Side_over_head'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Head_office_over_head'); ?></th>
<th><?php echo $form->textField($model,'Head_office_over_head'); ?></th>
<th><?php echo $form->error($model,'Head_office_over_head'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Profit'); ?></th>
<th><?php echo $form->textField($model,'Profit'); ?></th>
<th><?php echo $form->error($model,'Profit'); ?></th>
</tr>
<tr><th><p>----------------------------------------------------------------------------</p></th></tr>
<tr>
<th><?php echo $form->labelEx($model,'Rate'); ?></th>
<th><?php echo $form->textField($model,'Rate'); ?></th>
<th><?php echo $form->error($model,'Rate'); ?></th>
</tr>
<tr>
<th><?php echo $form->labelEx($model,'Amount_Total'); ?></th>
<th><?php echo $form->textField($model,'Amount_Total'); ?></th>
<th><?php echo $form->error($model,'Amount_Total'); ?></th>
</tr>
</table>
</fieldset>
</div>
</div>
<div class="row buttons" style="margin-left:580px">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Save' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->