Here's my issue, I have this form name survey which have a textfield named: email on it
<form name="survey">
<label id="email">Email:</label><input id="email" type="text">
</form>
Email is store into a global variable in javascript.
<script>
var email = survey.email.value;
function openwindow() {
window.location.href = "test.php?email=" + email;
}
</script>
Now I have another button that suppoused to be executing function openwindow():
<input name="button" type="button" onClick="openwindow();" value="Send to PHP">
For some reason it is not happening, it stays in the same window and nothing change.
It needs to send the variable email to the PHP page so I can print it there:
The code for test.php is the following:
<?php
echo "<h1>Your Email is:</h1>";
echo "Email : ".$_GET['email']."<br>";
?>


Reply With Quote
Bookmarks