Here is my js code
<script>
function myform() {
var n = document.getElementById("name").value;
if (n == "") {
document.getElementById("username").innerHTML = "Please enter your name";
return false;
}
if (!isNaN(n)) {
document.getElementById("username").innerHTML = "Please enter valid name";
return false;
}
}
</script>
How to write this js code into php
m trying all code in echo but not working plz help
after php echo using
echo'<script>
function myform() {
var n = document.getElementById("name").value;
if (n == "") {
document.getElementById("username").innerHTML = "Please enter your name";
return false;
}
if (!isNaN(n)) {
document.getElementById("username").innerHTML = "Please enter valid name";
return false;
}
}
</script>';
thankyou
source https://stackoverflow.com/questions/68595890/how-to-add-javascript-into-php
Comments
Post a Comment