is there a way to remove text from a text box using a submit button?
I don’t want to delete text from all boxes on the form.
And I don’t want to delete text ‘onclick’, for the element.
I need the code to clear the text box, to initiate 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"
}
?>
Thanks for your help!
You can do it in two ways:
using onclick handler of the submit button in javascript
using php
if(count($_POST) > 0)
{
$_REQUEST[‘text’] = $_GET[‘text’] = $_POST[‘text’] = ”;
}