目前,我有一个客户输入工作数据的页面。可以选择说明他们的客户是否同意工作表数据:
<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>
目前,如果工作表尚未达成一致,我有应该隐藏“agreedby”字段的 Javscript:
<script type="text/javascript">
$(document).ready(function(){
$("#JobsheetAgreed").change(function() {
($(this).val() == "0") ({
$("#agreedby").hide();
});
($(this).val() == "1") ({
$("#agreedby").show();
});
});
});
</script>
但这似乎没有任何作用。有没有人有任何想法?