Click to See Complete Forum and Search --> : Need so_is_this' help on auto-populate
Chamark
12-05-2006, 01:08 PM
so is this...you were my hero before, I'm hoping that you come to my assistance again. Same application (see partial code). I need to also auto-populate the site field based on the same query that fetches Assocfield, badgeid. The site field represents which location that the Associate is in and needs to change whenever the dropdown associate list changes just like the badgeid does, I tried putting in an additional line for site.value....but am at a loss...thank you
<input type="hidden" Name="Assocname" value="" />
<table width="80%" border="0" align="center" bgcolor="#EEEEEE">
<tr>
<td width="15%">Associate's Name </td>
<td width="18%"><label>
<select name="Assocfield" id="Assocfield" onchange="
AssocID.value = this.options[this.selectedIndex].value;
site.value = this.options[this.selectedIndex].text;
Assocname.value = this.options[this.selectedIndex].text;
return true;" >
<option value=""></option>
<%
While (NOT getinfo.EOF)
%>
<option value="<%=(getinfo.Fields.Item("Rep Ssn").Value)%>"><%=(getinfo.Fields.Item("Associate").Value)%></option>
so_is_this
12-05-2006, 10:30 PM
I need to also auto-populate the site field based on the same query that fetches Assocfield, badgeid. The site field represents which location that the Associate is in and needs to change whenever the dropdown associate list changes just like the badgeid does, I tried putting in an additional line for site.value....but am at a loss...
Need a little more information. Are you saying that you have three pieces of data that needs to go in this SELECT? That can be done, but I just need to verify that is what you want. If not, please explain further. Thanks.
Chamark
12-06-2006, 05:19 AM
Correct. I have a select statement that gives me the associate, badgeid, and site. The associate field is a dropdown menu of names and as you helped me before, I can select a name from the dropdown menu and the badgeid textbox changes accordingly. I now need the site field to change the same way as the badgeid does when an associate is selected from the dropdown menu. Thank you so much again!!!
so_is_this
12-06-2006, 03:33 PM
Build your OPTION tag this way:
<option value="<%=(getinfo.Fields.Item("Rep Ssn").Value)%>|<%=(getinfo.Fields.Item("site").Value)%>"><%=(getinfo.Fields.Item("Associate").Value)%></option>
Then, you can use this code:
<select name="Assocfield" id="Assocfield" onchange="
var ary = this.options[this.selectedIndex].value.split('|');
AssocID.value = ary[0]; site.value = ary[1];
Assocname.value = this.options[this.selectedIndex].text;
return true;" >
Chamark
12-06-2006, 04:00 PM
For some reason the site field (textbox) is not populating the the site name that corresponds to the Associate????
Here is my Select statement:
Set getinfo_cmd = Server.CreateObject ("ADODB.Command")
getinfo_cmd.ActiveConnection = MM_MetricsCONN_STRING
getinfo_cmd.CommandText = "SELECT Top 100000 associate, [rep ssn], Site FROM [National Call Stats] WHERE ([Date] >= '11/01/2006') Group by Associate, [rep ssn], Site Order By Associate"
getinfo_cmd.Prepared = true
Here is what I put in from what you gave me:
<input type="hidden" Name="Assocname" value="" />
<table width="80%" border="0" align="center" bgcolor="#EEEEEE">
<tr>
<td width="15%">Associate's Name </td>
<td width="18%"><label>
<select name="Assocfield" id="Assocfield" onchange="
var ary = this.options[this.selectedIndex].value.split('|');
AssocID.value = ary[0]; site.value = ary[1];
Assocname.value = this.options[this.selectedIndex].text;
return true;" >
<option value=""></option>
<%
While (NOT getinfo.EOF)
%>
<option value="<%=(getinfo.Fields.Item("Rep Ssn").Value)%>|<%=(getinfo.Fields.Item("site").Value)%>"><%=(getinfo.Fields.Item("Associate").Value)%></option>
<%
getinfo.MoveNext()
Wend
If (getinfo.CursorType > 0) Then
getinfo.MoveFirst
Else
getinfo.Requery
End If
%>
</select>
so_is_this
12-06-2006, 05:38 PM
Make sure all capitalizations match. I merely used what you posted.
Chamark
12-06-2006, 07:14 PM
You are a wizard. Where do I send the check? Another quick question. This form I have built for the client has 59 entry fields (call center grading form). Doing some Javascript on the form to calculate scores. As the user fills out the form before submitting to the server the response slows down considerably. When I say slows down I mean when a click on a yes/no dropdown or filling out a comment section there is noticable response delay. Is this normal? Again thank you for all that you have done for me!!!!
so_is_this
12-07-2006, 01:30 PM
You are a wizard. Where do I send the check?
I'll bill you later.
As the user fills out the form before submitting to the server the response slows down considerably. When I say slows down I mean when a click on a yes/no dropdown or filling out a comment section there is noticable response delay. Is this normal?
No, it is not. This would indicate the JavaScript logic needs an overhaul.
Chamark
12-07-2006, 01:34 PM
Do I dare assume that you are also a JS pro? If so may I have you look at my code on how I calculate scores?
so_is_this
12-07-2006, 01:59 PM
Yes, I am also a JavaScript expert. However, on these forums (and for free), I only deal with actual error situations because these usually have quick fixes. Analyzing a full set of code to make logic adjustments for performance improvement is a more time-con$uming proce$$.
Chamark
02-13-2007, 08:52 AM
Build your OPTION tag this way:
<option value="<%=(getinfo.Fields.Item("Rep Ssn").Value)%>|<%=(getinfo.Fields.Item("site").Value)%>"><%=(getinfo.Fields.Item("Associate").Value)%></option>
Then, you can use this code:
<select name="Assocfield" id="Assocfield" onchange="
var ary = this.options[this.selectedIndex].value.split('|');
AssocID.value = ary[0]; site.value = ary[1];
Assocname.value = this.options[this.selectedIndex].text;
return true;" >
You were so kind as to help me before with this, I am hoping I can come to you again for assistance. In my Select statement I have added Manager & Manager ID and I want to insert their values as hidden and not on the form for folks to see. The Manager & Manage ID coorespond to the AssocID and would be inserted at the time the form is submitted. Can you help me with this? Thanks in advance!!