Hi, I'm in D6.6 and try to get rid of the resize handle of the textarea. In node 68684 I followed the code to do that and it worked. The rsize handle disappeared BUT also the textarea got shrinked to no more than 3 cols. What code should I use to remain with a normal sized textarea WITHOUT the resize grip.
As I searched the forum without result, I hope you can help me to get that code.

Thank you for the help.
Felix

CommentFileSizeAuthor
#5 email-form.png19.03 KBdaddydo

Comments

quicksketch’s picture

Disabling the resize doesn't affect the number of cols, unless you've change that also.

$element['#resizable'] = FALSE; // This does the resizing.
$element['#cols'] = 60; // This sets the number of columns.

Another likely occurrence is that you need to add some CSS to the page to set the width of the textarea, since CSS takes precedence over what's specified in the cols attribute anyway.

textarea.form-textarea {
  width: 100%;
}
daddydo’s picture

Hi,
This is why you've called yourself QUICKsketch. Really fast! Thank you, I'll try the code and I'll let you know about it.

daddydo’s picture

Hi,

$element['#resizable'] = FALSE; // This does the resizing.
$element['#cols'] = 60; // This sets the number of columns.

I've put above code into the template.php file and it is doing nothing. Suspect something is missing...

quicksketch’s picture

What's the code you're using currently? I'm a bit confused about what you're referring to. The code I posted above was an example that would need to be adjusted depending on the context of its use.

daddydo’s picture

StatusFileSize
new19.03 KB

Hi,
I send you a snapshot of the form, its name is "Opdracht", it resides in node 5. Further I put the above mentioned code in the template.php file, just that.
I think there should be a a function that direct the change to that only form, so it does not affect other forms, but I don't know how to write the code. Im a designer, know very little of php.
Thanks for your help!

daddydo’s picture

Hi,
This is what I've found so far. It works, but it makes the textareas in the admin. mode to disappear. So the edit field of the content area is not there anymore.

function phptemplate_textarea($element) 
{
$element['#resizable'] = false ;
return theme_textarea($element) ;
} 

Maybe you can help me with the right code.
Thank you.

pebosi’s picture

you could use my patch #343172: Disable textarea resizing instead of overriding theme functions.

daddydo’s picture

Thank you pebosi! I'm certainly going to try your patch, though I've never used patches before.

quicksketch’s picture

Status: Active » Closed (duplicate)

#343172: Disable textarea resizing has been committed and will be in 2.5