<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic DataGrid - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="/easyui/jquery-easyui-1.4.2 (1)/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/easyui/jquery-easyui-1.4.2 (1)/themes/icon.css">
<script type="text/javascript" src="/easyui/jquery-easyui-1.4.2 (1)/jquery.min.js"></script>
<script type="text/javascript" src="/easyui/jquery-easyui-1.4.2 (1)/jquery.easyui.min.js"></script>
</head>
<body>
<?php
//require_once '../demo/common.php';
require_once '../model/nba.class.php';
$nba = new model_nba();
$id = isset($_GET['id']) ? $_GET['id'] : '';
if($id) {
$data = $nba->fetchRecord($id);
//print_r($data);
}
?>
<form method="post" id="abc">
<input type="hidden" id="id" name="id" value="<?php echo isset($data['id'])?$data['id']:'';?>">
请输入城市名:<input type="text" name="city" id="city" value="<?php echo isset($data['city'])?$data['city']:'';?>" >
请输入球队名:<input type="text" name="username" id="username" value="<?php echo isset($data['username'])?$data['username']:'';?>">
<input type="submit" value="确定">
</form>
<script type="text/javascript">
$('#abc').form({
url:'deal.php',
onSubmit: function(){
/*需要手书写开始*/
var _city = $('#city').val();
if (_city.length < 1) {
alert('dddd');
return false;
}
/*需要手书写结束*/
},
success:function(data){ 这里的data就是普通字符串
var _obj = jQuery.parseJSON(data); 把普通字符串转换为json
// console.log(data);//firefox chrome
/*需要手书写开始*/
if(_obj.code == 200) {
location.href = 'xin/grid.php';
} else {
alert(_obj.msg);
}
/*需要手书写结束*/
}
});
// 提交 form
</script>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic DataGrid - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="/easyui/jquery-easyui-1.4.2 (1)/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/easyui/jquery-easyui-1.4.2 (1)/themes/icon.css">
<script type="text/javascript" src="/easyui/jquery-easyui-1.4.2 (1)/jquery.min.js"></script>
<script type="text/javascript" src="/easyui/jquery-easyui-1.4.2 (1)/jquery.easyui.min.js"></script>
</head>
<body>
<?php
//require_once '../demo/common.php';
require_once '../model/nba.class.php';
$nba = new model_nba();
$id = isset($_GET['id']) ? $_GET['id'] : '';
if($id) {
$data = $nba->fetchRecord($id);
//print_r($data);
}
?>
<form method="post" id="abc">
<input type="hidden" id="id" name="id" value="<?php echo isset($data['id'])?$data['id']:'';?>">
请输入城市名:<input type="text" name="city" id="city" value="<?php echo isset($data['city'])?$data['city']:'';?>" >
请输入球队名:<input type="text" name="username" id="username" value="<?php echo isset($data['username'])?$data['username']:'';?>">
<input type="submit" value="确定">
</form>
<script type="text/javascript">
$('#abc').form({
url:'deal.php',
onSubmit: function(){
/*需要手书写开始*/
var _city = $('#city').val();
if (_city.length < 1) {
alert('dddd');
return false;
}
/*需要手书写结束*/
},
success:function(data){ 这里的data就是普通字符串
var _obj = jQuery.parseJSON(data); 把普通字符串转换为json
// console.log(data);//firefox chrome
/*需要手书写开始*/
if(_obj.code == 200) {
location.href = 'xin/grid.php';
} else {
alert(_obj.msg);
}
/*需要手书写结束*/
}
});
// 提交 form
</script>
</body>
</html>