Commit 0f8e2c87 by Wittaya-PIM

AddCards : ปรับValidate

parent fedb47c7
......@@ -12,7 +12,6 @@
<?php echo $this->Form->create('UserCards', [
'id' => 'frmSignIn',
'type' => 'file',
'onsubmit' => 'return check();',
'url' => ['controller' => 'user-cards', 'action' => 'view-card']
]); ?>
<div class="form-group has-feedback">
......@@ -20,25 +19,22 @@
<?php echo $this->Flash->render(); ?>
<?php echo $this->Form->hidden('UserCards.user_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'userId', 'type' => 'text', 'placeholder' => 'USERNAME']); ?>
<?php echo $this->Form->hidden('UserCards.organize_id', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_id', 'type' => 'text', 'label' => __('ไอดีใช้งาน'), 'placeholder' => 'USERNAME']); ?>
<?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'organize_code', 'type' => 'text', 'label' => __('Company Code'), 'placeholder' => 'Company Code']); ?>
<?php echo $this->Form->input('UserCards.organize_code', ['class' => 'form-control-reg border-bottom-from label-text-sub required alphanumeric', 'id' => 'organize_code', 'type' => 'text', 'label' => __('Company Code'), 'placeholder' => 'Company Code']); ?>
<label id="nameorg_th" style="color: green"></label>
<label id="noorg_th" style="color: red"></label>
</div>
</div>
<div class="form-group has-feedback">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required', 'id' => 'employee', 'type' => 'text', 'label' => __('Ref 1'), 'placeholder' => 'Ref 1', 'disabled']); ?>
<?php echo $this->Form->input('UserCards.employee', ['class' => 'form-control-reg border-bottom-from label-text-sub required alphanumeric', 'id' => 'employee', 'type' => 'text', 'label' => __('Ref 1'), 'placeholder' => 'Ref 1', 'disabled']); ?>
<label id="nameemp_th" style="color: green"></label>
<label id="noepm_th" style="color: red"></label>
</div>
</div>
<div class="form-group has-feedback bootstrap-iso">
<div class="col-xs-12 col-sm-12 col-md-12">
<label class="label-text-sub">
<?php echo __('Ref 2');?>
</label>
<input type="text" name="UserCards[birthdate]" id="date" placeholder="Ref 2" value="" readonly placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy"
class="form-control-reg border-bottom-from" disabled>
<label class="label-text-sub"><?php echo __('Ref 2');?></label>
<input type="text" name="UserCards[birthdate]" id="date" placeholder="Ref 2" value="" readonly placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from required" disabled>
<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div>
</div>
......@@ -53,9 +49,6 @@
</div>
<!--/.col-xs-12 -->
<?php $this->append('scriptBottom'); ?>
<script type="text/javascript">
var organize_id = $("#organize_id");
......@@ -147,24 +140,6 @@
date_input.datepicker(options);
});
function check() {
if ($("#organize_code").val() == '') {
alert("<?php echo __('Please enter Company Code') ?>");
organize_id.focus();
return false;
}
if (employee.val() == '') {
alert("<?php echo __('Please enter Ref1') ?>");
employee.focus();
return false;
}
if (date.val() == '') {
alert("<?php echo __('Please enter Ref2') ?>");
date.focus();
return false;
}
}
</script>
<style>
#alertBox {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment