Results 1 to 4 of 4

Thread: clearing textarea

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: clearing textarea

    if the form is submitted, just dont echo the text into the text area...
    My usual boring signature: Something

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    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
  •  



Click Here to Expand Forum to Full Width