So I've built hundreds of forms before, all with no issues, but for some reason unknown to me this one doesn't seem to be working. This form is in its infancy to later be plugged into a larger web application. I've checked my code over and over again, checked if PHP is functioning properly, etc, yet I've had no luck fixing my issue.
The problem is that I cannot access any of the data within my form from PHP. Even further, once the form is posted it does not append the form data to the URL. Instead I just get www.example.com/list.php?
Hopefully I've just overlooked something, but the only other thing I can possibly think of is it has something to do with JQuery. If you guys could just take a look at my code and see if there are any glaring errors I would really appreciate it.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>list</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script>
$(window).load(function(){
var counter = 1;
$('button.remove').click(function(){
if(counter >= 1){
$("#cnt" + counter).remove();
counter--;
$('#count').attr('value', counter);
}
});
$('button.add').click(function(e){
e.preventDefault();
counter++;
$('#count').attr('value', counter);
var newData = '<tr style="display:none" id="cnt' + counter + '"><td><input type="text" value="Content' + counter + '"/></td></tr>';
$(newData).appendTo('#myTable').fadeIn('slow').slideDown('slow');
});
});
</script>
</head>
<body>
<button class="add"> + </button><button class="remove"> - </button>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<table id="myTable">
<tr>
<td><input type="text" value="Content1" id="cnt1" /></td>
</tr>
</table>
<input type="hidden" id="count" value="10" />
<input type="submit" value="Submit" />
</form>
<?php
echo $_GET['count'];
?>
</body>
</html>