troubleshooting Question

How to return drop down list to original state

Avatar of OrionsX
OrionsX asked on
JavaScriptMicrosoft Legacy OSAJAX
11 Comments1 Solution406 ViewsLast Modified:
I have a program where the dropdown list originally gets populated in HTML. When the user selects a particular item from another list the first list changes its contents. I would like the first list to revert back to its original state when any other item is selected that doesn't match the specified criteria.
// This creates the original list in HTML
<h1>CFDA #:</h1>
	<div id="CFDA_Number">
	<Select name="CFDANumber">
	<option value="00000">00000 - No CDFA</option>
	</Select>
	</div>
 
//If a user selects "02-Federal Funds" from a 2nd DDL then GetCFDA() is called which repopulates new items into the original DDL. If anything other than "02-Federal Funds"  is slected then I want to rever back to only having "00000 - No CDFA" in the original list
 
var CFDA_NumberText = document.getElementById("CFDA_Number");
if (rtSource == "02-Federal Funds"){
GetCFDA();
}
else {
 
//The lines below don't work but they were some things I have tried
CFDA_NumberText.innerHTML = "00000 - No CDFA";
CFDA_NumberText.innerHTML = document.getElementById("CFDA_Number");
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros