How to clear text box in php

藏色散人
Release: 2023-03-05 16:42:01
Original
2397 people have browsed it

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.

How to clear text box in php

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[&#39;submit&#39;] == "submit")
{
  //clear text box with name "text"
}
?>
Copy after login

Solution:

You can do it in two ways:

在javascript中使用submit按钮的onclick处理程序
Copy after login

Use PHP

if(count($_post)>0)
{
$请求[&#39;text&#39;]=$获取[&#39;text&#39;]=$发布[&#39;text&#39;]=&#39;&#39;;
}
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!