"how to write javascript code inside php" Code Answer


Just echo the javascript out inside the if function

 <form name="testForm" id="testForm"  method="POST"  >
     <input type="submit" name="btn" value="submit" autofocus  onclick="return true;"/>
        echo "
            <script type="text/javascript">
            var e = document.getElementById('testForm'); e.action='test.php'; e.submit();
By dattatray026-2d28e1066aec on August 22 2022

Answers related to “how to write javascript code inside php”

Only authorized users can answer the search term. Please sign in first, or register a free account.