|
-
May 9th, 2008, 04:31 PM
#1
clearing textarea
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 10th, 2008, 11:53 AM
#2
Re: clearing textarea
if the form is submitted, just dont echo the text into the text area...
My usual boring signature: Something
-
May 15th, 2008, 06:48 AM
#3
Re: clearing textarea
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 18th, 2008, 11:37 AM
#4
Re: clearing textarea
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|