Please, help me to solve this problem
When I am trying Single input value then input value transfer data.php file successfully and I get input value in data.php file to write this code echo $name=$_POST[‘name’]; but I can transfer input array value in data.php file, actually I have not enough knowledge about jquery. So anyone can help me to solve this problem. What’s the write jquery code for transferring array value in data.php file and what’s the write php code for echo.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function get(){
$('#age').hide();
$.post('data.php',{ name: form.name.value },
// this code don't work in array
// how can i transfer name[] value in data.php file
function (output){
$('#age').html(output).fadeIn(1000);
});
}
</script>
<body>
<form name="form" action="a.php">
<input type="text" name="name[]" value="1"/>
<input type="text" name="name[]" value="2"/>
<input type="button" value="Get" onclick="get();"/>
</form>
<div id="age">
</div>
</body>