home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
61.19.244.139
/
61.19.244.139.zip
/
61.19.244.139
/
2015-02-19
/
views
/
car-type-setup-edit.jsp
< prev
next >
Wrap
Text File
|
2015-02-19
|
4KB
|
104 lines
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<form:form cssClass="form-horizontal well" method="Post" action="updateVehCode" modelAttribute="vehCodeForm" id="frmSaveVehCode" name="frmSaveVehCode" >
<fieldset>
<div class="control-group">
<label class="control-label" for="input01">ประเภทรถยนต์</label>
<div class="controls">
<form:select cssClass="span3" path="vehType" name="vehType" id="vehType" multiple="false" itemLabel="vehType" itemValue="vehType">
<form:options items="${vehTypeList}" itemValue="refCode" itemLabel="refDesc1"/>
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01" >ลักษณะการใช้รถรถยนต์</label>
<div class="controls">
<form:select cssClass="span3" path="vehUsage" name="vehUsage" id="vehUsage" multiple="false" >
<form:options items="${vehUsageList}" itemValue="refCode" itemLabel="refDesc1"/>
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01">รหัสรถยนต์</label>
<div class="controls">
<form:input cssClass="input-small" type="text" placeholder="รหัสรถยนต์" name="vehCode" id="vehCode" path="vehCode" readonly="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01">ขนาดรถยนต์:</label>
<div class="controls">
<form:radiobutton path="vehSizeFlag" name="vehSizeFlag" value="C" /> CC <form:radiobutton path="vehSizeFlag" name="vehSizeFlag" value="S" /> Seat <form:radiobutton path="vehSizeFlag" name="vehSizeFlag" value="W" /> Weight
</div>
</div>
<div class="control-group">
<label class="control-label" for="input02">ข้อความหน้าตารางกรมธรรม์</label>
<div class="controls">
<form:input cssClass="input-xlarge" type="text" id="vehPrintPol" name="vehPrintPol" path="vehPrintPol"
placeholder="ข้อความหน้าตารางกรมธรรม์"/>
</div>
</div>
<hr/>
<br/>
<br/>
<%
if (request.getParameter("vehCode") == null) {
%>
<button class="btn btn-success" name="saveBtn" id="saveBtn">บันทึก</button>
<%
} else {
%>
<button class="btn btn-primary" name="editBtn" id="editBtn">แก้ไข</button>
<%
}
%>
<a class="btn" id="cancelBtn" onClick="$('#tableFrm').dialog('close');">ยกเลิก/ปิด</a>
</fieldset>
</form:form>
<script>
$(function() {
$("#vehType").select2({ width: 'resolve' });
$("#vehUsage").select2({ width: 'resolve' });
$(document).ready(function() {
$("#carSizeForm").dynamiclist();
});
$("#frmSaveVehCode").submit(function() {
var url = "updateVehCode";
$.ajax({
type: "POST",
url: url,
data: $("#frmSaveVehCode").serialize(),
success: function(data)
{
$('#grid').trigger("reloadGrid", [{ page: 1 }]);
$('#tableFrm').dialog('close');
},
error: function (xhr, ajaxOptions, thrownError) {
var obj = JSON.parse( xhr.responseText);
alert(obj.errorMessages ) ;
}
});
return false;
});
});
</script>