When ever I pass a value from a form using submit to a php file using load, $.get or post and try to receive data or load it in general as shown below, I just get ruturned a null or undefined value. Anyone know what im doing wrong ?
iNDEX.HTML `
<script type = "text/javascript">
$(document).ready(function(){
$("#NewOrgForm").submit(function(){
var name = $("#companyname").val();
$(".content").load("NewEntry.php",{Name: name});
});
});
</script>
<form id="NewOrgForm">
<p> Name: <input type="text" id="companyname" value="" /> </p>
<p> <input type="submit" value="Submit New Entry" id="submit" /> </p>
</form>
NEWENTRY.PHP
<?php
$companyname = $_POST['Name'];
echo $companyname;
?>
`