hi all, please someone tell me what's wrong with this code ? why the form won't submitted ?
HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="jquery,ui,easy,easyui,web">
<meta name="description" content="easyui help you build your web page easily!">
<title>Grid Validation</title>
<link rel="stylesheet" type="text/css" href="
http://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="
http://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="
http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="
http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#xx').combogrid({
panelWidth:450,
required:true,
multiple:false,
idField:'code',
textField:'name',
url:'data/datagrid_data.json',
columns:[[
{field:'code',title:'Code',width:60},
{field:'name',title:'Name',width:100},
{field:'addr',title:'Address',width:120},
{field:'col4',title:'Col41',width:100}
]]
});
$('#ff').form({
success:function(data){
$.messager.alert('Info', data, 'info');
}
});
});
</script>
</head>
<body>
<form id="ff" method="post" action="index.php">
<table>
<tr>
<td>Name:</td>
<td><input type="text" name="name" style="width:350px;"/></td>
</tr>
<tr>
<td>Address:</td>
<td><input type="text" name="address" style="width:350px;"/></td>
</tr>
<tr>
<td>City:</td>
<td><select class="easyui-combotree easyui-validatebox" required="true" url="data/city_data.json" name="city" style="width:156px;"/></td>
</tr>
<tr>
<td>Item:</td>
<td><select class="easyui-validatebox" id="xx" name="xx" style="width:350px;"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit"></input></td>
</tr>
</table>
</form>
</body>
</html>
index.php
<?php
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$item= $_POST['xx'];
echo "Your Name: $name <br/> Your Address: $address <br/>Provinsi $item<br/> Your City ID: $city";
?>
data/datagrid_data.json
{
"total":239,
"rows":[
{"code":"001","name":"Name 1","addr":"Address 11","col4":"col4 data"},
{"code":"002","name":"Name 2","addr":"Address 13","col4":"col4 data"},
{"code":"003","name":"Name 3","addr":"Address 87","col4":"col4 data"},
{"code":"004","name":"Name 4","addr":"Address 63","col4":"col4 data"},
{"code":"005","name":"Name 5","addr":"Address 45","col4":"col4 data"},
{"code":"006","name":"Name 6","addr":"Address 16","col4":"col4 data"},
{"code":"007","name":"Name 7","addr":"Address 27","col4":"col4 data"},
{"code":"008","name":"Name 8","addr":"Address 81","col4":"col4 data"},
{"code":"009","name":"Name 9","addr":"Address 69","col4":"col4 data"},
{"code":"010","name":"Name 10","addr":"Address 78","col4":"col4 data"}
]
}
data/city_data.json
[{
"id":1,
"text":"City",
"children":[{
"id":11,
"text":"Wyoming",
"children":[{
"id":111,
"text":"Albin"
},{
"id":112,
"text":"Canon"
},{
"id":113,
"text":"Egbert"
}]
},{
"id":12,
"text":"Washington",
"state":"closed",
"children":[{
"id":121,
"text":"Bellingham"
},{
"id":122,
"text":"Chehalis"
},{
"id":123,
"text":"Ellensburg"
},{
"id":124,
"text":"Monroe"
}]
}]
}]