<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
$().ready(function(){
	$("#addForm").validate({
		rules: {
			'data[MobilePlatform][platform_name]' : {
				'required' : true,
				'remote' : {
					url:'./index.php',
					cache:false,
					data:{
						r:'MobileSet.checkplatform',
						platformName:function(){
						return $("#MobilePlatform_platform_name").val();
						}
					}
				}
			},
			'data[MobilePlatform][show_order]' : {
				'required' : true,
				'digits' : true,
				'range' : [1,99]
			}
		},
		messages: {
			'data[MobilePlatform][platform_name]' : {
				'required' : '软件平台不能为空',
				'remote' : jQuery.format('软件平台{0}已存在，请重新输入')
			},
			'data[MobilePlatform][show_order]' : {
				'required' : '排列顺序不能为空',
				'digits' : '排列顺序必须为整数',
				'range' : '排列顺序必须在1-99之间'
			}
		},
		errorPlacement: function(error, element){
			$("#span_" + element.attr("id")).html(error).attr("class", "error");
		},
		submitHandler: function(form){
			setDisabled(":button",window.document);
			form.submit();
		},
		errorClass: "invalid",
		success: function(label){
			label.parent().html("&nbsp;").attr("class", "valid");
		}
	});
});
</script>
</head>
<body>
<form action="index.php?r=MobileSet.addplatform" method="post" id="addForm">
<table class="tbl_edit" width="100%">
	<tr>
		<td class="td_name">软件平台<span class="red">*</span></td>
		<td class="td_content"><input type="text" name="data[MobilePlatform][platform_name]" id="MobilePlatform_platform_name" class="text" maxlength='30'/><span id="span_MobilePlatform_platform_name"></span></td>
	</tr>
	<tr>
		<td class="td_name">排列顺序<span class="red">*</span></td>
		<td class="td_content"><input type="text" name="data[MobilePlatform][show_order]" id="MobilePlatform_show_order" class="text" value="99" maxlength='2'/><span id="span_MobilePlatform_show_order"></span></td>
	</tr>
	<tr>
		<td class="noborder"></td>
		<td class="noborder"><button type="submit" class="butsubmit">提交</button></td>
</tr></table>
</form>
</body>
</html>