Jump to content

how Convert javascript variable into php variable


beboo002

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.