I've tried atleast a dozen different attempts at solving the problem of submitting form data to my database without reloading the page and scrolling to the top. With every attempted solution it continues to submit and scroll to the the top of the page in both chrome and safari.
//JAVA
<script type="application/javascript">
function doitall()
{
function validateHistory()
{
var x=document.getElementById("hist").value;
if(x==""}
function(e) {
e.preventDefault();
// Great isnt it
return false;
}
</script>
// FORM
<form action="search.php" onsubmit="return doitall();">
<td bgcolor="#242424"><input class="textinput" type="text" value="" name ="hist" id ="hist" placeholder="Address" size="50"/></td><td bgcolor="#242424"><input type="hidden" value= name = id = size="100"/></td>
<td bgcolor="#242424"><input type="hidden" value=<?php echo $num;?> name ="number" id ="number" size="50"/></td>
<td bgcolor="#242424"><input type="hidden" value= name = id = size=""/></td>
<td bgcolor="#242424"><input type="submit" value="Submit onsubmit="return doitall();" class="buttonx"/>