Print Page | Close Window

auto-populate

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25900
Printed Date: 28 March 2026 at 2:21pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: auto-populate
Posted By: a_roy
Subject: auto-populate
Date Posted: 27 June 2008 at 8:40pm
Hi all,
 
 I am trying to design a web based form in ASP.NET, this is what i want.
 
when the user clicks on an item from a pull down menu, i want that to be listed in a dynamically generated text box with a check box next to it for approval.
e.g. when the user selects five different items from the pull down menu then i want all five of them listed in a column( preferrably) with check boxes next to each of them.
 
i am totally new to asp.net C# , working as an intern , so any help or hints would be really helpful. Looking forward to replies.
Thanks
Andy



Replies:
Posted By: Videoediting
Date Posted: 07 August 2008 at 12:50pm
You can do this buy using javascript;

Here is the code for generating dynamic textbox
function abc(){
var myTable=document.getElementById('myTable');
var lastRow=myTable.rows.length;
var val='';
var rows = myTable.getElementsByTagName('tr');
var cels = rows[lastRow-1].getElementsByTagName('td');
var row = myTable.insertRow(lastRow);

var cell = row.insertCell(0);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name','addte');
val='d'+lastRow;
el.setAttribute('id','d'+lastRow);
cell.appendChild(el);
}

similarly add lines to this function to generate dynamic checkbox.
Call this function on the click event on the item of the pull down menu.

Cheers,

SPBig%20smile
http://www.videoediting-direct.co.uk



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net