<html>
<head>Testing</head>
<body>
<?php
if(isset($_POST['postbtn'])){
echo "<script>alert('I am here')</script>";
echo "<script>document.getElementById('txt_name').value='edit'</script>";
}
?>
<div id="wrap">
<form id="data_entry" method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
<div class="rowbox">
<input type="text" class="textbox" id="txt_name" value="">
</div>
<div class="btn">
<input type="submit" id="postme" name="postbtn">
</div>
</form>
</div>
</body>
</html>
I'm new to javascript and php, what I need to know is after submitting the form I can see the alert message "I am here" but I don't see the value that I am posting using the document.getElementById in the textfield for the html form. Why?
Thanks