Skip to content

Tag: html

How to clear an HTML Form, even the form’s initial values?

I have an HTML form that sends information via post to a PHP file. On the user’s second visit the page should remember the last search input. So if on their first visit they were looking for pencil then on their second visit, the form would already have prefilled the Product Name input with pencil. I&#8…

How can I call a Javascript variable on PHP(HTML)

So what I’m trying to do is something like this: I want to name the new dynamic textbox. So I could call it later on another PHP page. Answer You have to send the javascript value through ajax POST to the server and read the post via php. Not so sure what your aim is but let me know if

how to include javascript inside html

Sorry for asking this silly question. I got stuck to include a javascript file in my html page in a php project. when I try this it works fine- <script type=”text/javascript” src=”script.js”></script> But when I want to load the script.js file from my js directory it does n…

PHP handling the addition of a class to an HTML element

I need to achieve the following: I have a php file responsible for sending my form. Everything works fine but I want php to add the class active to a div in my HTML so that a popup of message sent can be displayed on the page to the user. Here’s my html: this is my php script at the