i have a html form with 2 textboxes and a textarea, the form submit calls a php function on the server, i would like to clear the textboxes if the function succeeds, can i do this? either from the server script or on the page that calls php function
Printable View
i have a html form with 2 textboxes and a textarea, the form submit calls a php function on the server, i would like to clear the textboxes if the function succeeds, can i do this? either from the server script or on the page that calls php function
if the form is submitted, just dont echo the text into the text area...
i am not echoing anything, so i am not sure if i can use this
i load a new page that confirms the script completed successfully, then redirect back to the previous page
i am probably not using the best code, but i am new to php and not much good a java
php loads a fail or success page, then returns to the original page, is there a better way to do this
The textarea shouldn't have anything in it after the form is submitted unless you put something there, ie: echo $_POST['name_of_textarea']...that is what dclamp was saying...
What do you mean you want to clear the textbox if the function succeeds? How are you "calling on a PHP function"? Are you using JavaScript/AJAX or something?
When you redirect back to the previous page there should be nothing in the TextArea unless you're doing a JavaScript/"back button" redirect or something which is not the way to do it.Quote:
i load a new page that confirms the script completed successfully, then redirect back to the previous page
Can you clarify what you're doing...