Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

adding textarea on onclick

Posted on 2003-12-09
3
Medium Priority
?
264 Views
Last Modified: 2011-04-14
I need to give the user a button , whenever he/she clicks on it a new textarea is created. The user can add any no. of textarea's in this manner.
Plz suggest
0
Comment
Question by:mathew189
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
thomas908 earned 660 total points
ID: 9909841
<script type="text/javascript">
var TRCount =0;
var showCount=0;

function insRow()
{
    var x=document.getElementById('myTable').insertRow(TRCount)
    var y=x.insertCell(0)
    var z=x.insertCell(1)
    showCount = TRCount + 1
    y.innerHTML=showCount
    z.innerHTML="<TEXTAREA style=overflow:hidden NAME='task"+TRCount+"' ROWS='' COLS='45'></TEXTAREA>"
    TRCount++;
}
</script>
<table id="myTable">

</table>
<input type="button" onclick="insRow()" value="Insert">
0
 
LVL 8

Expert Comment

by:thomas908
ID: 9909854
Does that solve ur problem?
let us know if u have any other query
0
 

Author Comment

by:mathew189
ID: 9909879
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question