×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Dynamic Textarea Problem

Dynamic Textarea Problem 11 years 4 months ago #22048

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Hello Daniel,

The dynanamictextarea.js interferes with my design.

Textarea is not scrollable, even if I apply overflow-y:auto

You can test the behaviour at www.planevo.de/blog/87-feedback-zu-coach...aren.html#!/ccomment

I need to have a fixed height of 140px with scrollbar when a user enters long text.

I tried to set the height in default_form.php of my template:
<textarea name='comment' class='ccomment-textarea required' cols='5' tabindex='5'
			          rows='20'
			          placeholder='Schreiben Sie hier Ihren Kommentar:*'
			          style='height:140px; overflow-y:auto'
				></textarea>

But everything I set there gets overridden by dynamictextarea.js, I guess.

So I set this in my template's css:
.ccomment-textarea {
  height: 140px !important;
}

Now I have the fixed height. But when I enter many lines, they disappear out of view and I can't make the textarea scrollable.

How can I disable dynamictextarea.js? I tried commenting it out in default.php, line 52
//Jhtml::script('media/com_comment/js/dynamictextarea.js');

But then the whole form doesn't load anymore.

Please help, thank you.

Cheers
gerhard

Dynamic Textarea Problem 11 years 4 months ago #22072

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Gerhard,
Once you uncomment the jhtml::script line you'll need to edit the media\com_comment\js\views\comments-outer.js file.

Line 402 has the following code:
textarea.store('dynamictextarea',
					new DynamicTextarea(textarea)
				);
change it to:
textarea.store('dynamictextarea',textarea);

Dynamic Textarea Problem 11 years 4 months ago #22079

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Thank you for that solution.

Will I have to redo this after I update the component?

Cheers
gerhard

Dynamic Textarea Problem 10 years 11 months ago #24491

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
To answer this myself: yes, after an update I have to redo these changes.

Also in my case I had to comment out line 408:
//new PlaceholderSupport(form.getElements('input[placeholder],textarea[placeholder]'));
  • Page:
  • 1
Time to create page: 0.195 seconds