php method to clear the text box: 1. Use the onclick handler of the submit button in javascript; 2. Use the php code [if(count($_post)>0){...}] method Clear the text box.
Recommended: "PHP Video Tutorial"
php clear text box
Specific question:
Is there a way to remove text from a text box using a submit button?
I don't want to delete the text in all the boxes on the form.
I don't want to remove the element's text "onclick".
I need code to clear a textbox, initiated from within a block.
For example
<input name="text" value="submit" /> <input type="sumbit"/> <?php if($_POST['submit'] == "submit") { //clear text box with name "text" } ?>
Solution:
You can do it in two ways:
在javascript中使用submit按钮的onclick处理程序
Use PHP
if(count($_post)>0) { $请求['text']=$获取['text']=$发布['text']=''; }
The above is the detailed content of How to clear text box in php. For more information, please follow other related articles on the PHP Chinese website!