By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

how to increase rows of a textarea

P: n/a

hi,
iwant to add dynamically some rows in same textarea when a button of
addRows is clicked.
like,if i have 2 rows in a textarea then after clicking a button the
rows must be increased to 4.
help me soon.
thanks
*** Sent via Developersdex http://www.developersdex.com ***
Sep 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi garima,
garima puri wrote:
hi,
iwant to add dynamically some rows in same textarea when a button of
addRows is clicked.
like,if i have 2 rows in a textarea then after clicking a button the
rows must be increased to 4.
help me soon.
thanks
*** Sent via Developersdex http://www.developersdex.com ***


Here is how i do it.

<html>
<body>
<textarea id="txtarea" cols="30" rows="5"></textarea>
<input type="button" value="Increment Rows" onClick="moreRows()">
<script language="javascript" type="text/javascript">
function moreRows() {
document.getElementById('txtarea').rows += 2;
}
</script>
<body>
</html>

-- Peroli Sivaprakasam

Sep 20 '05 #2

P: n/a
McA
> hi,
iwant to add dynamically some rows in same textarea when a button of
addRows is clicked.
like,if i have 2 rows in a textarea then after clicking a button the
rows must be increased to 4.


function addRow(){
document.getElementById("your_textarea_ID").rows+= 2;
}
Sep 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.