3
I know the question may have already been asked, but in no case solved the problem I have, I need to take the value of a Jquery variable and pass to one in PHP, the variable in Jquery is being created like this:
// Gerando números para cada ciclo do processo
if( $("#LinkDocumento").val() != "" && $("#Etapa").val() == 1) {
var Numero = Math.floor(Math.random() * 11);
} else if ( $("#LinkDocumento").val() != "" && $("#Etapa").val() == 2) {
var Numero = Math.floor(Math.random() * 11);
} else {
var Numero = Math.floor(Math.random() * 11);
}
And I tried to play the value in a variable PHP
thus:
$EtapaForm = "<script>document.write(Numero)</script>";
But I’m not getting it, the result is like this:
The variable I am trying to rescue will be passed as parameter to another form that is being rescued through the variable #LinkDocumento
, that is, this variable brings me from the bank a path.
Suggestion for reading: http://answall.com/a/43739/129
– Sergio
You can make a simple
window.location.href = "url.php?EtapaForm=" + Numero
. But the recommended is to use ajax.– Eduardo Silva