現在、クライアントがジョブデータを入力するページがあります。クライアントがジョブシートデータに同意したかどうかを判断するオプションがあります。
<div id="modalwindow">
<div class="leftcolumn">
<?php
echo $this->Form->create('Jobsheet', array(
'class' => 'form-horizontal',
'id' => 'addquickJobsheet'
));
echo $this->Form->input('jobnum', array(
'type' => 'text',
'lable' => 'Job ID',
'class' => 'span5',
'placeholder' => 'Enter the job ID here'
));
echo $this->Form->input('jobdate', array(
'type' => 'text',
'label' => 'Date',
'class' => 'span5',
'placeholder' => 'YYYY/MM/DD'
));
echo $this->Form->input('siteaddress', array(
'type' => 'hidden',
'value' => $sites['Siteaddress']['id']
));
echo $this->Form->input('bins', array(
'label' => 'Bins',
'class' => 'span5',
'placeholder' => 'Enter the number of bins here'
));
echo $this->Form->input('company', array(
'value' => $companyid,
'type' => 'hidden',
'label' => 'Company',
'class' => 'span5'
));
echo $this->Form->input('driverid', array(
'options' => $driverselect,
'empty' => 'Select Driver',
'label' => 'Driver',
'class' => 'span5'
));
echo $this->Form->input('vehicleid', array(
'options' => $vehicleselect,
'empty' => 'Select Vehicle',
'label' => 'Vehicle',
'class' => 'span5'
));
echo $this->Form->input('contract', array(
'value' => $contractid,
'type' => 'hidden',
'label' => 'Contract',
'class' => 'span5'
));
?>
</div>
<div class="rightcolumn">
<?php
echo $this->Form->input('skipsize', array(
'options' => $skipsizes,
'empty' => 'Select Skip Size',
'label' => 'Skip Size',
'class' => 'span5'
));
$ao = array('1' => 'Yes', '0' => 'No');
echo $this->Form->input('recweight', array(
'label' => 'Weight Of Skip',
'class' => 'span5',
'placeholder' => 'Enter the weight here'
));
$agval = array('1' => 'Yes', '0' => 'No');
echo $this->Form->input('agreed', array(
'label' => 'Agreed?',
'options' => $agval,
'class' => 'span5',
'value' => '1'
));
?>
<div id="agreedby">
<?php
echo $this->Form->input('agreedby', array(
'label' => 'Agreed By',
'class' => 'span5',
'placeholder' => 'Enter who agreed this job sheet here'
));
?>
</div>
<?php
echo $this->Form->input('deleted', array(
'type' => 'hidden',
'value' => '0'
));
echo $this->Form->submit('Next', array(
'class' => 'btn btn-primary'
));
echo $this->Form->end();
?>
</div>
</div>
現時点では、ジョブシートが合意されていない場合に「同意者」フィールドを非表示にすることになっているJavscriptがあります。
<script type="text/javascript">
$(document).ready(function(){
$("#JobsheetAgreed").change(function() {
($(this).val() == "0") ({
$("#agreedby").hide();
});
($(this).val() == "1") ({
$("#agreedby").show();
});
});
});
</script>
しかし、これは何もしないようです。誰かアイデアはありますか?