Jump to content

Remove Text From Textarea


norNerd

Recommended Posts

Hi, i was told to use this function from another page, but did not work.

 <textarea id="myTextarea" name="myTextarea">	Text to be removed</textarea><input type="button" onclick="document.getElementById('myTextarea').value=''" value="Remove Text" />

Also tried to add java script:before document.get +++But returned the same error: nothing happens :)Thanks kris

Link to comment
Share on other sites

You should actually try modifying both the innerHTML and the value.It's confusing, but until you write something in the textarea object the property you have to modify is innerHTML. Once somebody types in the box, you have to modify the value property.

Link to comment
Share on other sites

So what i should do?This?

document.getElementById('myTextarea').innerHTML='';document.getElementById('myTextarea').value='';

In that case, it dident work, added those 2 to a function, and onclick="name_of_function();"Any other ideas? :)kris

Link to comment
Share on other sites

How about using onfocus instead, that way it works if someone tabs to the textarea or clicks in it.

Link to comment
Share on other sites

LOL! had a wysiwyg editor messing it up for me BIG time...It does not only changes my textarea to a div, it changes its id and name to..Thanks for helping guys, think i'll be needing to know this later =)

Link to comment
Share on other sites

WYSIWYG == teh ebil

Link to comment
Share on other sites

I only started learning to code because my dad asked me to make a site for him and my brother had had a little experience with DreamWeaver and recommended I try it. I did, but it wasn't quite as easy to use as I expected. Nor was Microsoft's....something web, whatever it was called. In order to use them I had to learn HTML anyway, and it just ended up being easier to do it by hand. Not that I'm an expert, but I find it more straightforward and more interesting just doing it all by hand.

Link to comment
Share on other sites

Hehe funny way to start chibineku :)Found myself starting to learn php/mysql before html, started to learn by downloading mafia game scripts, then read it line for line, and hour for hour i learnd more and more, but tok me ages to figure out that i had to learn html/css to..Now i can say i can hand code a little table, but must say i find dreamweaver more effective :) But might be becouse i hate figureing out those cols and rowspans ;)Have any links to sites i can check out? Working for a company interesting in designers from time to another :)Hehe, great point Deirdre`s Dad, can truly say i've runned into the wall a few times :)Kris

Link to comment
Share on other sites

I was never a fan of WYSIWYG editors, mainly because of all the extraneous crap it added to the code. However I initially learned the bad habit of positioning with liberal use of tables, which itself can be a mess. After months of study and practice, I've learned to use CSS, and although at the time it seemed like alot of extra work, but it's definitely is worth the time as site management for consistency and style is a breeze! Thanks for your help W3Schools and the experts on this forum! :)

Link to comment
Share on other sites

It is really remarkable how the thoughtful use of CSS can simplify HTML. The latest addition to my knowledge has been use of the inline-block. Before, I would stick items inside divs to position them. I still do, but not as much, and more for semantic grouping than layout. My documents are half the size they used to be, which was already half the size of documents laid out with tables.(Anyone reading this for advice should read about the limitations on inline-block in IE.)

Link to comment
Share on other sites

Nope - Expressionweb. I think it was MS. Expressionweb was better than Dreamweaver, but looking back either package may actually be ok, but you still need to know HTML. I remember being perplexed by these little tools saying things like 'insert div'. WTF? was my reaction then.

Link to comment
Share on other sites

Dreamweaver is much more featureful than Expression Web. However, it is also much more expensive.

Link to comment
Share on other sites

My brother had one of the Lynda/HOT books on Dreamweaver. There was a fantastic error in it where they explained how to change the width of something, and showed you a before and 'now it should look like this!'-after picture - they were identical. Summed up my experiences as a novice using Dreamweaver. I'm sure I'd be able to get it to work now that I know what it should be doing, but I like writing it.

Link to comment
Share on other sites

You mean Hot Lynda, doncha champ? The one with the purrty ladies who lost their clothes?

Link to comment
Share on other sites

You mean Hot Lynda, doncha champ? The one with the purrty ladies who lost their clothes?
someone should help them find them...it is flu seasons after all.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...