Lee R Liddick Jr
asked on
Form Auto-Population
I have a form, that once the user chooses a name, I want it to automatically fill in information from the query onto the form.
<CFQUERY datasource="myds" name="employees" blockfactor="100">
SELECT *
FROM tbl_employees
WHERE Active=1
ORDER BY SortName asc
</CFQUERY>
And the form just looks like this:
Name: Drop Down box with names from the above employees query
Agt ID: Blank Box (this is where I want the agt ID from the employees query to populate automatically when the user chooses a name from the above box.
Is there any way to do this?
<CFQUERY datasource="myds" name="employees" blockfactor="100">
SELECT *
FROM tbl_employees
WHERE Active=1
ORDER BY SortName asc
</CFQUERY>
And the form just looks like this:
Name: Drop Down box with names from the above employees query
Agt ID: Blank Box (this is where I want the agt ID from the employees query to populate automatically when the user chooses a name from the above box.
Is there any way to do this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try this piece of code....
<javascript>
function entsub() {
function ConfirmSSN(sSSN)
{
document.all.WorkFrame.src = "confirmSSN.cfm?SSN=" + sSSN;
}
function enterinfo()
{
document.employees.SSN.val ue = retssn;
ConfirmSSN(retssn)
}
</script>
<body bgcolor="silver">
<!--- Begin Form --->
<table style="border-width: thin; border-color: black; border-style:
solid;">
<tr>
<td>
<table cellspacing="2" cellpadding="2" border="0">
<form name="employees" action="index.cfm" method="post">
<tr>
<td colspan="2" class="text"><font style="font-size:
8pt;"><strong>Search Employees By Social Security
Number</strong></font></td >
</tr>
<tr>
<td class="text">SSN:</td>
<td><input type="text" name="SSN" class="field" size="10"
onkeyup="entsub();" ondblclick="ConfirmSSN(thi s.value);" > <a href="#"
onclick="showModalDialog(' namepopup. cfm',windo w,'dialogH eight:276p x;dial
ogWidth:261px');" name="button" id="button"><img src="popup.gif"
border="0"></a></td>
</tr>
<!---Hide rest of form until --->
<tr>
<td class="text">Last Name:</td>
<td><input READONLY type="text" name="last" size="15"
class="nonfield"></td>
</tr>
<tr>
<td class="text">First Name:</td>
<td><input READONLY type="text" name="first" size="15"
class="nonfield"></td>
</tr>
<!--- end div --->
</form>
</table>
</td>
</tr>
</table>
<!--- end form--->
<!--- create Workframe --->
<iframe id="WorkFrame" name="WorkFrame" height="0" width="0"></iframe>
<javascript>
function entsub() {
function ConfirmSSN(sSSN)
{
document.all.WorkFrame.src
}
function enterinfo()
{
document.employees.SSN.val
ConfirmSSN(retssn)
}
</script>
<body bgcolor="silver">
<!--- Begin Form --->
<table style="border-width: thin; border-color: black; border-style:
solid;">
<tr>
<td>
<table cellspacing="2" cellpadding="2" border="0">
<form name="employees" action="index.cfm" method="post">
<tr>
<td colspan="2" class="text"><font style="font-size:
8pt;"><strong>Search Employees By Social Security
Number</strong></font></td
</tr>
<tr>
<td class="text">SSN:</td>
<td><input type="text" name="SSN" class="field" size="10"
onkeyup="entsub();" ondblclick="ConfirmSSN(thi
onclick="showModalDialog('
ogWidth:261px');" name="button" id="button"><img src="popup.gif"
border="0"></a></td>
</tr>
<!---Hide rest of form until --->
<tr>
<td class="text">Last Name:</td>
<td><input READONLY type="text" name="last" size="15"
class="nonfield"></td>
</tr>
<tr>
<td class="text">First Name:</td>
<td><input READONLY type="text" name="first" size="15"
class="nonfield"></td>
</tr>
<!--- end div --->
</form>
</table>
</td>
</tr>
</table>
<!--- end form--->
<!--- create Workframe --->
<iframe id="WorkFrame" name="WorkFrame" height="0" width="0"></iframe>
ASKER
pindaldave, umbrae, and blackops...i've tried those suggestions and still can't get it to work. The best I've gotten was the one from blackops, but it's giveing me a wrong value in the Agt ID box. I will look at this again sometime soon, but going to just divide the points between you guys and try and figure it out later. Thanks...
I think I can speak for umbrae and pindaldave, that it's not just about points. We want to help you get this deal working. Post the code that you are using and I'll give you some more advice on what to populate where.
-- Ian
-- Ian
ASKER
Yes I know, just didn't want to keep this open until I got to it. I just opened another question and it is posted at https://www.experts-exchange.com/questions/21172334/F-U-to-Qn-ColdFusion-Q-21170271-html-pindaldave-umbrae-and-blackops.html if you wanted to take a look at it. Thanks guys...
Empolyee account :<input type="text" name="activated_accounts1"
I will post hte code for this automatically populated by selecting drop down soon.
Regards,
---Pinal