by clicking on a dynamically generated button how can i delete a dynamictext box

This is a discussion on "by clicking on a dynamically generated button how can i delete a dynamictext box" within the JavaScript Forum section. This forum, and the thread "by clicking on a dynamically generated button how can i delete a dynamictext box are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 19th, 2006, 08:59
New Member
Join Date: Nov 2006
Location: india
Age: 24
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question by clicking on a dynamically generated button how can i delete a dynamictext box

how can i write code for "remove textarea" in the following code?
<html>
<head>
<script language="javascript">
function genBox(n)
{
var thebox = document.createElement('textarea');
thebox.setAttribute('rows','10');
thebox.setAttribute('cols','30');
thebox.setAttribute('id','textBoxId');
document.getElementById(n).appendChild(thebox);
var but=document.createElement('input');
but.setAttribute('type','button');
but.setAttribute('value','remove textarea');
but.setAttribute('name','remove');
document.getElementById('boxhold1').appendChild(bu t);

}
</script>
</head>
<body>
<input name="Input" type=button onclick="genBox('boxhold1')" value="insert textarea" />
<div id="boxhold1"></div>
</body>
</html>
Reply With Quote

  #2 (permalink)  
Old Nov 20th, 2006, 21:02
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: by clicking on a dynamically generated button how can i delete a dynamictext box

You can assign a removal function to the button at its time of construction just the same as you are already assigning other attributes.
Reply With Quote
Reply

Tags
clicking on button, delete textarea, javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop the browser refresh on clicking the webbrowser's refresh button ? camarun20 JavaScript Forum 3 Mar 18th, 2008 23:04
FLASH - validating input fields if empty before clicking submit button kyutkb Flash & Multimedia Forum 3 Jul 24th, 2007 15:38
Editing and Delete problem Dynamically ScorpionKing JavaScript Forum 1 Jun 29th, 2007 13:21
Problem opening page in dynamically generated iframe Malkalypse JavaScript Forum 3 Jun 20th, 2005 20:38
Delete All Row (Select All Row Using Radio Button) Monie Classic ASP 37 Nov 5th, 2004 09:21


All times are GMT. The time now is 10:37.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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 32 33 34 35 36 37 38 39 40 41 42 43