-
Set the onfocus of the text box and clear the contents.
-
Does it become the default after it is cleared? What I'm trying to say is, did you submit a request for that button click event? If not, then the situation you are talking about is not possible. I wrote a small example, you see:
-
I don't know if it works by calling the reset() method.
-
Set an onclick method to the text box.
function click()
-
Default value'}" onfocus="if('I'm the default')"/>
Copy the ** above into the html file yourself. Try it. If you don't meet the requirements, adjust it yourself.
-
function issupportplaceholder ()if(!issupportplaceholder())= function ()
The placeholder attribute is provided in HTML5 to do this, so we can first consider using the method provided by the browser.
If this property is not supported, then use js to implement it.
-
You can use the onfocus and onblur events of the text box to determine whether the text box is empty or not, and if it is empty, it is the default text.
-
After submitting the form, the text box is not empty.
1. Use the form to submit, add the data of the text box to the script and then return to refill the text box.
2. Use ajax
The content in the text box for the next login will remain the same.
Save to a database (or a text file, which has to be saved somewhere on the server anyway) the first time you enter something
The next time you log in, insert the data and repopulate the text box.
-
After logging in, filling out the form, and submitting it.
Write information to a database or hard disk.
The next time you log in, you can read a database or hard drive file and display the data into a form.
-
This has to be stored in a database to store the input data......
-
It's best to set the original value to a hidden field when you enter the page, and read it every time you commit an input failure. This hidden field can be placed under your input box. For example:
-
Wouldn't it be okay to give him a null value directly?