Click to See Complete Forum and Search --> : clearing textarea
westconn1
May 9th, 2008, 04:31 PM
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
dclamp
May 10th, 2008, 11:53 AM
if the form is submitted, just dont echo the text into the text area...
westconn1
May 15th, 2008, 06:48 AM
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
DigiRev
May 18th, 2008, 11:37 AM
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?
i load a new page that confirms the script completed successfully, then redirect back to the previous page
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.
Can you clarify what you're doing...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.