Page 1 of 1

How Do You Change Textarea Box Size? [SOLVED]

Posted: 01 Dec 2008, 23:57
by stanhook
Hi,

I have disabled the TinyMCE text editor so I could have a plain box. But the box is too large and I need to make it smaller. I have changed the settings in parameters, tried changing the view.html.php file and some others. I have poked around and changed other stuff only to come up empty. Could you please point me in the right direction?

Thanks!

Stan

Re: How Do You Change Textarea Box Size ?

Posted: 02 Dec 2008, 18:11
by Jan
Hi, try to set the table width too (in parameters component)


this is the code for displaying the textarea:

Code: Select all

if ($tmpl['enableeditor'] == 1) {
			$editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
		} else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
		
		}
in
components\com_phocaguestbook\views\phocaguestbook\view.html.php

Jan

Re: How Do You Change Textarea Box Size ?

Posted: 02 Dec 2008, 18:58
by stanhook
Hi Jan,

I changed your the cols attribute code in the view.html.php to this:

Code: Select all

if ($tmpl['enableeditor'] == 1) {
			$editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
		} else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="5" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
		
		}
and I changed the default.php in the tmpl folder to:

Code: Select all

<table border="0" style="margin-left: 40px;" width="350px">
but still no luck. I have spent half a day and my mind is melting. I had tried some code that suggested to change the textarea totally but then I had other issues.

By the way, the parameters in the backend are set to text editor no and the table and editor width and height to 100px. Still no effect.

In the view.html.php page should I change the style=width also?

What am I missing?

Re: How Do You Change Textarea Box Size ?

Posted: 02 Dec 2008, 19:31
by stanhook
If got it fixed. Here is what I did:

I used this code in the view.html.php page:

Code: Select all

if ($tmpl['enableeditor'] == 1) {
			$editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
		} else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
		
		}
and changed the $editor = '<textarea ... to this:

Code: Select all

 else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="5" rows="10" style="width: 300px; height:200px;" >'.$formdata->content.'</textarea>';
		
		}
I don't know if the cols and row attribute matter. But it was the width and height that fixed my issue.

Thanks Jan for pointing me in the right direction.

Stan

Re: How Do You Change Textarea Box Size? [SOLVED]

Posted: 02 Dec 2008, 20:52
by Jan
great to hear it, Jan

Re: How Do You Change Textarea Box Size? [SOLVED]

Posted: 20 Dec 2008, 22:39
by slymndvc
Hi,

I was looking for how to change the dimentions of the text area and find this post, but my situation is TinyMCE enabled. I have changed the parameters from the backand but nothing changed. I have also tried to change the code written above post, but couldn't get any result.

Code: Select all

    if ($tmpl['enableeditor'] == 1) {
             $editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
          } else {
             $editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
          
          }
Would you please show me what should be changed on the code above to solve the problem given in the attached image?

Re: How Do You Change Textarea Box Size? [SOLVED]

Posted: 22 Dec 2008, 21:11
by Jan
Did you change the pareamters in Parameters Component in menu link to Phoca Guestbook?

Re: How Do You Change Textarea Box Size? [SOLVED]

Posted: 25 Dec 2008, 22:06
by slymndvc
Jan wrote:Did you change the pareamters in Parameters Component in menu link to Phoca Guestbook?
Dear Jan,
Of course, firstly I have tried to change parameters from the component menu, but it didn't work. I think I have to change something from below, but not sure where;

Code: Select all

   } else {
             $editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
         
          }
I have used the code below (which is posted by stan);

Code: Select all

else {
         $editor = '<textarea id="pgbcontent" name="pgbcontent" cols="5" rows="10" style="width: 300px; height:200px;" >'.$formdata->content.'</textarea>';
      
      }
but then I got the error message "Parse error: syntax error, unexpected T_ELSE in /home/eressam/public_html/components/com_phocaguestbook/views/phocaguestbook/view.html.php on line 151"

So, still I need help.

Frienly regards.

Suleyman

Re: How Do You Change Textarea Box Size? [SOLVED]

Posted: 26 Dec 2008, 22:50
by Jan
Hi, the parse error is error in php script, somewhere you have lost ; or ) (, try to check your code