Merge branch 'ui_ux_changes' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
<%= f.input :queue_no , :class => "dining",:id => "dining", :readonly => true%>
|
<%= f.input :queue_no , :class => "dining",:id => "dining", :readonly => true%>
|
||||||
<%= f.hidden_field :customer_id %>
|
<%= f.hidden_field :customer_id %>
|
||||||
<%= f.input :name %>
|
<%= f.input :name %>
|
||||||
<%= f.input :contact_no %>
|
<%= f.input :contact_no , input_html: { min: 1, :onkeypress => "return isNumberKey(event);", :onkeyup => "notChar(this.value);" } %>
|
||||||
<%= f.input :seater %>
|
<%= f.input :seater , input_html: { min: 1, :onkeypress => "return isNumberKey(event);", :onkeyup => "notNegative(this.value);" } %>
|
||||||
<%= f.input :remark %>
|
<%= f.input :remark %>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
@@ -111,11 +111,29 @@
|
|||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function isNumberKey(evt) {
|
||||||
|
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||||
|
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function notNegative(val){
|
||||||
|
if(parseInt(val)< 1) $("#dining_queue_seater").val(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function notNegative(val){
|
||||||
|
if(typeof val == "string") $("#dining_queue_seater").val(0);
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
if($('form').attr('id') == "new_dining_queue"){
|
if($('form').attr('id') == "new_dining_queue"){
|
||||||
var queue_no = $('.generate_no').text();
|
var queue_no = $('.generate_no').text();
|
||||||
$('#dining_queue_queue_no').val(queue_no);
|
$('#dining_queue_queue_no').val(queue_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
$( "input" ).focusin(function() {
|
$( "input" ).focusin(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user