Automatically increase height of textarea when add news » DataLife Engine Support

DLEVIET - DataLife Engine Support Home Page

DataLife Engine Support » DataLife Engine » Edit Code » Automatically increase height of textarea when add news

Automatically increase height of textarea when add news

  • Author: admin;  
  • Views: 2315;  
  • Date: 11 July 2009;  
Automatically increase height of textarea  when add news


1. Open file addcomments.tpl and focus in : class

<textarea name="comments" class="f_textarea" id="comments" >{text}


We have class : f_textarea

2. Open all .css file of current template and find f_textarea

Like this
.f_textarea {
color: #757575;
font-size: 11px;
font-family: tahoma;
background-image: url(../images/dlet_field_o.gif);
background-repeat: repeat-x;
width: 459px;
height: 156px;
border: 1px solid #e0e0e0;


We edit height

.f_textarea {
color: #757575;
font-size: 11px;
font-family: tahoma;
background-image: url(../images/dlet_field_o.gif);
background-repeat: repeat-x;
width: 459px;
min-height: 156px;
border: 1px solid #e0e0e0;


3. Open file addcomments.tpl

At top of this file, add

<script language="javascript">
function countLines(strtocount, cols) {
    var hard_lines = 0;
    var last = 0;
    while ( true ) {
        last = strtocount.indexOf("n", last+1);
        hard_lines ++;
        if ( last == -1 ) break;
        }
    var soft_lines = Math.ceil(strtocount.length / (cols-1));
    var hard = eval("hard_lines " + unescape(">") + "soft_lines;");
    if ( hard ) soft_lines = hard_lines;
    return soft_lines;
}
function cleanForm() {
    var the_form = document.getElementById('comments');
    the_form.rows = countLines(the_form.value,the_form.cols) +1;
    setTimeout("cleanForm();", 500);
}
cleanForm();
</script>


Finish
We encourage you to Register or Login to website under your name.
Information
Members of Guest cannot leave comments.

Pagerank Update

    Updates Yandex SEO
    13.04.2012
    16.02.2012
    04.02.2012
    Updates Yandex search
    17.05.2012
    15.05.2012
    12.05.2012
    Updates Yandex Catalogue
    18.05.2012
    16.05.2012
    11.05.2012
    Updates Google
    03.05.2012
    06.02.2012
    08.11.2011

Find us on Facebook

Poll

How do you know DataLife Engine Support?

Search Engine
Other DLE Support websites
Forum
Friends
Others

Sponsor

Calendar

«    May 2012    »
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Contact us in social network

Facebook

Twitter