Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 859639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:42:20+00:00 2026-05-15T08:42:20+00:00

<textarea onfocus= javascript:clearContents(this); this.cleared=true; rows=5 cols=40 id=comment name=comment <?php if($vis[username] == $pusername) { echo

  • 0
<textarea onfocus=" javascript:clearContents(this); this.cleared=true;" rows="5" cols="40" id="comment" name="comment" <?php if($vis["username"] == $pusername) { echo "DISABLED"; } ?>>...</textarea>
<input onsubmit="if (!this.comment.cleared) clearContents(this.comment); return true;" type="submit" name="Submit" value="Stem!"/> 

function clearContents(element) {
  element.innerHTML = '';
}

This wont work, and i cant figure out why. What it does: clears the content if it hasnt been onfocus/clicked on by the person

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:42:21+00:00Added an answer on May 15, 2026 at 8:42 am
    clearContents( document.getElementById('comment') )
    

    You should bind onsubmit to the <form> and do this unobtrusively, ideally…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<textarea name=inputField id=inputField tabindex=1 rows=2 cols=40onblur=DoBlur(this); onfocus=DoFocus(this); ></textarea> <input class=submitButton inact name=submit type=submit value=update
textarea onclick=this.focus(); this.select(); rows=1 cols=100 readonly=readonly style=background: #ffffcc; font-family: Monospace;> a href=http://127.0.0.1:8000/ajax/share?url=...... onclick=window.open(this.url, 'blabla',
this is my textarea prepared for ckeditor to launch on: <textarea name=Message id=RFMessage lol
<input name=textbox type=text value=Click here to type onfocus=if(this.value=='Click here to type')this.value=''; onblur=if(this.value=='')this.value='Click here to
I have a comment box that is basically a textarea. I set the cols
I have a textarea with this content: <textarea id=text> Hello! Who am I? This
This is a textarea. The user can write anything. <textarea id=text>First sentence. Second sentence?
Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea that has a background image,
Have textarea wrapped in parent div element. This textarea becomes visible only when parent
I have a form like this: <form action=search.php class='search' method='GET'> <input type=text/submit class=home_search_area value=Search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.