Here’s my JS code…
function da(){
var a=document.forms["user"]["age"].value;
if(this.age.value < 18 || this.age.value > 85) {
alert('some text...');
this.age.focus();
return false;
}else{
window.location.href='file.php?&'+a;
}
}
It simply passes the parameters to the page where I’m standing…
Here’s the form just in case (I’m a beginner keep in mind)…
<form name="buscar" method="GET"> Some text <input onmouseover="Aj2('d');document.getElementById('box').style.display='block';" onmouseout="clean();" type="number" name="age" id="age" > Age <div id="help" ><!-- --> </div><br />
<input type="button" value="Send" onclick="da()">
</form>
The Aj2 function is not the problem here…
Thanks for any help y might get…
Just a thought, if you don’t actually have to reload the page and just want to get information to your javascript code from PHP, you could do something like
Now the javascript variable, jsvariable, will hold the PHP variable’s content.