Thats strange...I tried to replicate your error and my data was not erased.
PHP Code:
<?
if( $HTTP_POST_VARS['summ'] == "submitted"){
print "submitted";
$val = $HTTP_POST_VARS['sammyz'];
}
?>
<form name="sammy" action="index.php" method="post">
<input type="text" value="<?echo $val?>"name="sammyz" size="20">
<input type="hidden" name="summ" value="submitted">
<input type="checkbox" name="chekbox">
<input type="submit">
</form>
<?
function printEr(){
print("
<script type='text/javascript' language='javascript'>
<!--
alert('Error');
//-->
</script>
");
}
if( $HTTP_POST_VARS['chekbox'] ){
printEr();
}
?>
please forgive the messy coding, i just wanted to test how the data could have been erased.
basically i have a form that if the check box is checked, it will alert and simulate an error, then populate the form with the users data. When i press OK, the data remains