Click here to Skip to main content
15,892,059 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Is it impossible to specify height of tables with 100%? Pin
ZoogieZork13-Dec-03 20:14
ZoogieZork13-Dec-03 20:14 
QuestionReaching another WebForm in an another Frame? Pin
kimamundsen13-Dec-03 9:17
kimamundsen13-Dec-03 9:17 
AnswerRe: Reaching another WebForm in an another Frame? Pin
Colin Angus Mackay13-Dec-03 9:43
Colin Angus Mackay13-Dec-03 9:43 
GeneralDisable view source Pin
Not Active12-Dec-03 9:19
mentorNot Active12-Dec-03 9:19 
GeneralRe: Disable view source Pin
Paul Watson13-Dec-03 4:06
sitebuilderPaul Watson13-Dec-03 4:06 
GeneralRe: Disable view source Pin
Not Active13-Dec-03 7:59
mentorNot Active13-Dec-03 7:59 
GeneralDynamically Updating/Filtering List Box's Pin
DEWright_CA12-Dec-03 8:46
DEWright_CA12-Dec-03 8:46 
GeneralRe: Dynamically Updating/Filtering List Box's Pin
Torsten Mauz14-Dec-03 23:41
Torsten Mauz14-Dec-03 23:41 
ok here's a quick demo of what I think you want to achieve. This example should be fairly easy to make database driven (just create the javascript arrays through the backend). If you need any more advice with this then just give me a shout.

note: I have not tested this in NS, but it should be pretty straighforward to update (don't have time right now to do a cross-browser version).

ps: sorry for the porky code Smile | :)
<body onload="init();">

<script language="Javascript">
function Client(clientID, clientName)
{
	this.id = clientID;
	this.name = clientName;
}

function Project(projectID, projectName, clientID)
{
	this.id = projectID;
	this.name = projectName;
	this.clientID = clientID;
}

function Work(workID, projectID, workDescription)
{
	this.id = workID;
	this.projectID = projectID;
	this.description = workDescription; 
}

var arrClients = new Array();
var arrProjects = new Array();
var arrWork = new Array();

arrClients[0] = new Client(1, 'Company abc');
arrClients[1] = new Client(2, 'XYZ Ltd.');

arrProjects[0] = new Project(1, 'Website', 1);
arrProjects[1] = new Project(2, 'Intranet', 1);
arrProjects[2] = new Project(3, 'Report viewer', 2);
arrProjects[3] = new Project(4, 'Spreadsheet generator', 2);

arrWork[0] = new Work(1, 1, 'Database Design & Implementation');
arrWork[1] = new Work(2, 1, 'HTML Templates draft');
arrWork[2] = new Work(3, 2, 'Implement NTFS security');
arrWork[3] = new Work(4, 3, 'Implement Crystal reports functionality');
arrWork[4] = new Work(5, 3, 'Create graphing module');
arrWork[5] = new Work(6, 4, 'Submit for final budget approval');

function init()
{
	frmLists.sClient.options.length = 0;
	
	for(var i = 0; i < arrClients.length; i++)
	{
		frmLists.sClient.options.length += 1;
		frmLists.sClient.options[i].value = arrClients[i].id;
		frmLists.sClient.options[i].text = arrClients[i].name;
	}
	
	updateProjects();
}


function updateProjects()
{
	var clientID;
	var idx = 0;
	
	clientID = arrClients[frmLists.sClient.selectedIndex].id;
	frmLists.sProject.options.length = 0;
	
	for(var i = 0; i < arrProjects.length; i++)
	{
		if(arrProjects[i].clientID == clientID)
		{
			frmLists.sProject.options.length += 1;
			frmLists.sProject.options[idx].value = arrProjects[i].id;
			frmLists.sProject.options[idx].text = arrProjects[i].name;
			if(idx == 0)
				frmLists.sProject.options[idx].selected = true;
			idx++;
		}
	}
	
	updateWork();
}

function updateWork()
{
	var projectID;
	var idx = 0;
	
	projectID = frmLists.sProject.options[frmLists.sProject.selectedIndex].value;
	
	frmLists.sWork.options.length = 0;
	
	for(var i = 0; i < arrWork.length; i++)
	{
		if(arrWork[i].projectID == projectID)
		{
			frmLists.sWork.options.length += 1;
			frmLists.sWork.options[idx].value = arrWork[i].id;
			frmLists.sWork.options[idx].text = arrWork[i].description;
			idx++;
		}
	}
}
</script>

<form name="frmLists" action="whatever.asp" method="post">
	<select name="sClient" onchange="updateProjects();">
	</select>
	
	<br/>
	
	<select name="sProject" onchange="updateWork();">
	</select>
	
	<br/>
	
	<select name="sWork">
	</select>
	
	<br/>
</form>

</body>

QuestionPerformance of various web-delivery systems? Pin
Jeremy Kimball12-Dec-03 7:27
Jeremy Kimball12-Dec-03 7:27 
GeneralRSS Pin
allia12-Dec-03 0:53
allia12-Dec-03 0:53 
GeneralRe: RSS Pin
Paul Watson12-Dec-03 2:06
sitebuilderPaul Watson12-Dec-03 2:06 
GeneralRe: RSS Pin
allia12-Dec-03 3:30
allia12-Dec-03 3:30 
GeneralRe: RSS Pin
Paul Watson12-Dec-03 3:44
sitebuilderPaul Watson12-Dec-03 3:44 
GeneralRe: RSS Pin
allia12-Dec-03 8:03
allia12-Dec-03 8:03 
GeneralRe: RSS Pin
allia13-Dec-03 8:10
allia13-Dec-03 8:10 
GeneralProblem writing from global.asa to database Pin
K3na11-Dec-03 22:23
K3na11-Dec-03 22:23 
GeneralRe: Problem writing from global.asa to database Pin
Roger Wright11-Dec-03 22:41
professionalRoger Wright11-Dec-03 22:41 
GeneralRe: Problem writing from global.asa to database Pin
K3na11-Dec-03 22:47
K3na11-Dec-03 22:47 
GeneralRe: Problem writing from global.asa to database Pin
Roger Wright12-Dec-03 5:03
professionalRoger Wright12-Dec-03 5:03 
GeneralRe: Problem writing from global.asa to database Pin
kimamundsen13-Dec-03 9:14
kimamundsen13-Dec-03 9:14 
GeneralOdd apache error Pin
keegan11-Dec-03 19:09
keegan11-Dec-03 19:09 
GeneralRunning an .exe from my web page. Pin
d00_ape11-Dec-03 6:17
sussd00_ape11-Dec-03 6:17 
GeneralRe: Running an .exe from my web page. Pin
Paul Watson11-Dec-03 21:22
sitebuilderPaul Watson11-Dec-03 21:22 
GeneralRe: Running an .exe from my web page. Pin
anderslundsgard12-Dec-03 1:56
anderslundsgard12-Dec-03 1:56 
GeneralRe: Running an .exe from my web page. Pin
Paul Watson12-Dec-03 2:00
sitebuilderPaul Watson12-Dec-03 2:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.