beboo002 Posted March 27, 2008 Share Posted March 27, 2008 Hello all how Convert javascript variable into php variable. my form is ====================================== <form action="xyz.php" method="post" onsubmit="return validate();" name="form1" > function test() { var x=document.getElementById("emailid").value; <? ?> } </script> <input name="emailid" type="text" class="input" value="" onBlur="test()" id="emailid"></td> <input name="Submit3" type="submit" class="go" style="width: 180px;" value="Adevertise Now"> ================================================ now how can i Put var x value into $x; thanks beboo Link to comment https://forums.phpfreaks.com/topic/98143-how-convert-javascript-variable-into-php-variable/ Share on other sites More sharing options...
cooldude832 Posted March 27, 2008 Share Posted March 27, 2008 logically no because var X doesn't exist till the page is rendered and thus it is no use to php that has already died upon rendering the output. Now php variable $x can be used for a javaScript variable var x The only real way is AJAX. When the form is submitted the form inputs are placed in the $_POST array Link to comment https://forums.phpfreaks.com/topic/98143-how-convert-javascript-variable-into-php-variable/#findComment-502067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.