Solved

Dynamic Drop Down Box populated by Access tbl field with text box populated from the same table corresponding field

Posted on 2008-10-29
3
587 Views
Last Modified: 2010-05-18
Good day all.

I have a web form I have created. I have a field that requires the user to enter the ACNA (Access Carrier Name Abbreviation - telcom) and then the corresponding Customer name in the next text box.
I have both the ACNA and the corresponding Customer name in an Access Database (EAST_pm) and table (tblMasterACNA).

I would like to create a drop-down list for the ACNA, based on the field ACNA in tblMasterACNA. Once the user selects the ACNA the next text box would be populated automatically with the corresponding Customer Name in the Customer field from the tblMasterACNA.

I am using ASP, SQL and some Javascript on my site.
I have posted my code and has you can see, I am using a FIELDSET, not sure if that will matter.
This form is sent back to another table within the same database.

Thanks for your assist..
<html>
<head>
<title>Input</title>
<center>
<img src="logo_secondary.gif" class="floatTL"><br><br>	
</center>
 
<script Language="JavaScript">
<!-- 
function Blank_TextField_Validator(form)
{
 
 
if (Input.CAC.value.length < 1)
{
alert("Please enter a value for CAC.");
form.CAC.focus();
return (false);
}
 
 
if (Input.CKTID.value.length < 1)
{
alert("Please enter a value for CKTID.");
form.CKTID.focus();
return (false);
}
 
 
if (Input.ACNA.value.length < 1)
{
alert("Please enter a value for ACNA.");
form.ACNA.focus();
return (false);
}
 
 
if (Input.Ticket Number.value.length < 1)
{
alert("Please enter a value for Ticket Number.");
form.Ticket Number.focus();
return (false);
}
 
 
return (true);
}
 
//-->
</script>
 
 
 
 
<style type="text/css">
 
.progress{
	width: 1px;
	height: 14px;
	color: white;
	font-size: 12px;
  overflow: hidden;
	background-color: red;
	padding-left: 5px;
}
 
</style>
 
<script type="text/JavaScript">
 
function textCounter(field,counter,maxlimit,linecounter) {
	// text width//
	var fieldWidth =  parseInt(field.offsetWidth);
	var charcnt = field.value.length;        
 
	// trim the extra text
	if (charcnt > maxlimit) { 
		field.value = field.value.substring(0, maxlimit);
	}
 
	else { 
	// progress bar percentage
	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
	document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
	// color correction on style from CCFFF -> CC0000
	setcolor(document.getElementById(counter),percentage,"background-color");
	}
}
 
function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
 
</script>
 
 
 
 
<script type="text/javascript">
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      
 
</script>
<link href="" type="text/css" rel="stylesheet" media="all">
 
 
 
</head>
<center>
<body bgcolor="white" text="black"onLoad="self.focus();document.Input.CAC.focus()" >
 
<!-- Begin form code --> 
 
<FIELDSET>
<LEGEND><b><h1>Issue Referral Form</h1></b></LEGEND>
 
<H3>* All fields are required*</H3>
 
 
 
<form name="Input" method="Post" action="Confirm.asp">
 
<table>
<input type="hidden" name="Region" value="Potomac">
<input type="hidden" name="Date Added" value="<%=Date()%>" />
 
<tr><td>CAC: </td>
<tr><td><input type="text" name="CAC" size=40 value="" onChange="javascript:this.value=this.value.toUpperCase();"onkeypress="return handleEnter(this, event)"></td></tr>
 
 
<tr><td>CKTID: </td></tr>
<tr><td><input type="text" name="CKTID"  size=40 value="" onChange="javascript:this.value=this.value.toUpperCase();"onkeypress="return handleEnter(this, event)"></td></tr>
<tr><td>ACNA: </td></tr>
<tr><td><input type="text" name="ACNA" size=40 value="" onChange="javascript:this.value=this.value.toUpperCase();"onkeypress="return handleEnter(this, event)"></td></tr>
<tr><td>Customer: </td></tr>
<tr><td><input type="text" name="Customer" onkeypress="return handleEnter(this, event)"></td></tr>
<tr><td>Ticket Number: </td></tr>
<tr><td><input type="text" name="Ticket Number" size=40 value="" onChange="javascript:this.value=this.value.toUpperCase();"onkeypress="return handleEnter(this, event)"></td></tr>
<tr><td>Ticket Source: </td></tr>
<tr><td><SELECT NAME="Ticket Source" SIZE="1">
<OPTION SELECTED>PQI
<OPTION>WCH
</SELECT></td></tr>
 
 
<tr><td>Monitoring Source: </td></tr>
<tr><td><SELECT NAME="Monitoring Source" SIZE="1">
<OPTION SELECTED>PQI
<OPTION>WCH
</SELECT></td></tr>
 
<tr><td>Dispostion Code: </td></tr>
<tr><td><SELECT NAME="Dispostion Code" SIZE="1">
<OPTION SELECTED>PND
<OPTION>CDM
<OPTION>COF
<OPTION>CTT
<OPTION>DNA
<OPTION>FLD
<OPTION>NAR
<OPTION>OAT
<OPTION>OTH
<OPTION>SAV
<OPTION>SYS
</SELECT></td></tr>
 
<tr><td>Date Closed: </td>
<tr><td><input type="text" name="Date Closed" </td></tr>
 
<tr><td>Summary: (limited to 50 Characters)</td></tr>
<tr><td><textarea cols="50" name="Summary"size=40 value="" onChange="javascript:this.value=this.value.toUpperCase();"
onKeyDown="textCounter(this,'progressbar1',56)" 
onKeyUp="textCounter(this,'progressbar1',56)" 
onFocus="textCounter(this,'progressbar1',56)"
></textarea> </td></tr> 
</table>
 
<input type="submit" name="Submit" value="Submit Form" class="flashit" onClick='form_name.button_name.value="Please Wait...";return true'>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Clear Form">
 
<div id="progressbar1" class="progress"></div>
<script>textCounter(document.getElementById("maxcharfield"),"progressbar1",20)</script>
</form> 
</FIELDSET>
</center>
<!-- End form code -->
 
<script language="JavaScript1.2">
 
 
var flashcolor="red"
var flashinterval=1000 //flash interval in miliseconds (1000=0.5 sec)
 
var formcollect=document.getElementsByTagName? document.getElementsByTagName("FORM") : document.all? document.all.tags("FORM") : new Array()
var flashcollect=new Array()
 
for (i=0; i<formcollect.length; i++){
for (e=0; e<formcollect[i].elements.length; e++){
if (formcollect[i].elements[e].className=="flashit")
flashcollect[flashcollect.length]=formcollect[i].elements[e]
}
}
 
function flashelements(){
for (f=0; f<flashcollect.length; f++){
if (flashcollect[f].style.color=='')
flashcollect[f].style.color=flashcolor
else
flashcollect[f].style.color=""
}
}
 
if (flashcollect.length>0)
setInterval("flashelements()",flashinterval)
 
</script>
</body>
</html>

Open in new window

0
Comment
Question by:vzdog
  • 2
3 Comments
 
LVL 8

Expert Comment

by:saoirse1916
ID: 22833390
Here's what I use when I run into this requirement.  It's a combination of VBScript and JavaScript and it works very well, in my experience.

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14924&sliceId=1
0
 

Author Comment

by:vzdog
ID: 22836910
Not sure if this would wor or I should say not sure if I know how to modify it so it will work. As I said my requirement is that the specific ACNA field is tied to a specific customer name so there would not be a need to have a drop down.

suggestions?
0
 
LVL 8

Accepted Solution

by:
saoirse1916 earned 500 total points
ID: 22837683
Ahh, ok -- I was way off.  Check out something like this, it should do the trick.

http://www.adobeforums.com/webx/.3bc08f70
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP Sessions Being Cleared/Modified 6 79
Age between date range query (SP) 13 61
Microsoft SQL ADO Conn Issue 6 46
Hide cell in a table 2 9
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now