• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Textarea problem...

Sikes

New Member
Ok, look at the following code, it is a form textarea for a "test your html" page, so you put in your html and it shows what it looks like... :
Code:
<input type="button" value=" << " onClick="document.form.code.cols-=10" class="button"> <input type="button" value=" < " onClick="document.form.code.cols-=5" class="button"> &nbsp; <input type="button" value=" > " onClick="document.form.code.cols+=5" class="button"> <input type="button" value=" >> " onClick="document.form.code.cols+=10" class="button">
<form action="html-test_ACTION.php" method="post" name="form">
<textarea name="code" cols="60" rows="20" class="textarea" style="font-family:Courier New">
</textarea><br>
<input type="submit" value="Test It!" class="button">
</form>

See where the "<<", "<", ">" and ">>" buttons are, if you read the code, you'll see that it resizes the textarea colums.... It works in IE but I don't think it does in Netscape, I tried it on my school computer (Mac).

So, please tell me why it doesn't work, and if you know how to fix it!



Thanx!
 
Because this ads a little feature to my website...

But, how do you add a H-scroller to the TEXTAREA? I knew I did that once, but I forget how.... Or is that what you meant?
 
Not that I know or anything...but this part doesn't look right to me:

onClick="document.form.code.cols-=10

the "-=" part....

I think what you can do is declare a variable and set it to 60, then make it so when you press one button, it subtracts 10 from the variable, and sets the column width to that new value, and add ten for the other button. That should do it I think...
 
Sikes, someone posted a similar script somewhere else recently. He said the method isn't supported by NS4.
 
Back
Top