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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.