i have this code:
<div id="messageDiv">
<form>
<textarea name="message" rows="10" cols="20" id="message"></textarea></textarea>
<br /><br />
<input type="submit" value="Send" onClick="return sendmail()">
<input type="reset" value="Reset" name='reset'>
</form>
</div>
then i have my JS:
function sendmail()
{
var mail = document.getElementById('message').value;
window.location.href = "http://www.rainbowcode.net/apps_dev.php/profiles/mail?id="+mailid;
return false;
}
when i alert(mail) i get the correct value but when i get to my new page via window.location.href i want to access that value…my form is a “post” when i do a print_r($_POST['message']) i get an empty array..please help?
You have an error in your html that might affect it
should be
And also that is not how a post form is done. the send mail function is not helping at all
This should work
UPDATE:
You can always add hidden values that can be used for different purposes without being visible in the form. Like your mail id, it can be added to the form too: