You click a button and the form appears, right? I'm not understanding why the server needs to be involved at all.
<script>
function showTheInsert()
{
document.getElementById("theInsert").style.display = ";
}
</script>
<!-- ..... -->
<table name="buttons" width="465" border="1" cellpadding="1" cellspacing="0">
<tr><td align="center"><input type="button" value="New Input" onclick="showTheInsert()" /></td></tr>
</table>
And if you do need the server, you don't need any JavaScript.
<style>
#theInsert{
position:relative;
top:50px;
left:0px;
<?php
// Decide whether to print "display:none;" here or not.
?>
}
</style>
Of course, now there's no JavaScript, there's nothing to change the visibility of the form - so why put it in the page at all if no-one's going to see it?
if($_POST['action']=="visible"){
$ch = $_POST['choice'];
switch($ch){
case "New Input":
?>
<div id="theInsert">
<!-- ... -->
</div>
?>
break;
}
}
And what's with that table being used to lay out the button? What's wrong with using a bit of CSS instead?