Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box overlapping Second Box.

Status
Not open for further replies.

cranger01

IS-IT--Management
Oct 2, 2006
34
US
I have 2 text boxes. If you click on the first, a list box appears below it and you make a selection. In theory, when you click on the second, it should show a list box below it and you make a selection. The first list box is fine, but when you select from the second, not only does the second list box appear, but also the first one. Which I do not want. I tried setting the visibily to invisible for the first one when it is selcted, but that isn't really what I want to do. I basically copy and pasted the second part of code and changed all references to the original, so I don't know why that still displays when I click the the second list. I hope this makes sense.

<input type="hidden" name="hdnSort" value="<%=lblnsort%>"/>
<input type="hidden" name="hdnMode" id="hdnMode"/>
<tr class="contentPart">
<td align="left" width="15%">Select Customer:</td>
<td align="left" width="13%">&nbsp;</td>
<td align="left">
<input type="text" name="txtCustomer" id="txtCustomer" class = "txtCustPOMaint"
onKeyup="CustomerKeyIn(this);" tabindex="7"
autocomplete="off" onblur="fnblur()" onfocus="fnselect()" style="width:491px;"
size="65" value=""/>
<input type="button" id ="btnResort" name="btnResort" value="Resort" class="buttonpart"
onclick="fnSort();" tabindex="15"/>

</td>
</tr>
<tr class="content">
<td align="left" width="15%">&nbsp;</td>
<td align="left" width="13%">&nbsp;</td>
<td align="left">
<div id="divCustomerGroup" name="divCustomerGroup"
style="position:absolute; width:188px; height:95px; z-index:1; top: 90px; visibility:hidden;">
<select name="lstCustomerInfo" name="lstCustomerInfo" id="lstCustomerInfo" size="5"
onclick="fnclick()" onChange="LoadValues()" style = "width:491px;font-family:courier new">
<option Value = "INV">
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| ARG# &nbsp;&nbsp;&nbsp;&nbsp;| PRISM# | US/CA
</option>
<%
Set loCustMaint = CreateObject("BusCustMaint.clsbusCustomerMaint")
Set lrsCustRecord = CreateObject("Adodb.Recordset")
Set lrsCustRecord = loCustMaint.GetCustomerList(lblnsort,lsUserId)
If Not lrsCustRecord.EOF Then
While not lrsCustRecord.EOF

lsconcatvalue1 = InsertSpace(lrsCustRecord(0))
lsconcatvalue2 = trim(lrsCustRecord(1) &"")
lsconcatvalue3 = ltrim(lrsCustRecord(2) &"")
lsconcatvalue4 = trim(lrsCustRecord(3) &"")
lsConcatvalue = lsconcatvalue1 &" | "& lsconcatvalue3 &" | "& lsconcatvalue2 &" | " & lsconcatvalue4
%>
<option value=<%=lsconcatvalue2%>
<% If Trim(lsCustomer) = lsconcatvalue2 Then
Response.write " Selected"
End If%>
>
<%=lsConcatvalue%>
</option>
<%lrsCustRecord.MoveNext
Wend
End If
'Destroy Objects
Set lrsCustRecord = Nothing
Set loCustMaint = Nothing
%>
</select>
</div>
</td>
</tr>
<%
' 1260Drop Down List.
%>
<input type="hidden" name="hdnSort2" value="<%=lblnsort2%>"/>
<input type="hidden" name="hdnMode2" id="hdnMode2"/>
<tr class="contentPart">
<td align="left" width="15%">Select 1260:</td>
<td align="left" width="13%">&nbsp;</td>
<td align="left">
<input type="text" name="txtCustomer1260" id="txtCustomer1260" class = "txtCustPOMaint1260"
onKeyup="Customer1260KeyIn(this);" tabindex="7"
autocomplete="off" onblur="fnblur2()" onfocus="fnselect2()" style="width:491px;"
size="65" value=""/>
<input type="button" id ="btnResort2" name="btnResort2" value="Resort" class="buttonpart2"
onclick="fnSort2();" tabindex="15"/>

</td>
</tr>
<tr class="content">
<td align="left" width="15%">&nbsp;</td>
<td align="left" width="13%">&nbsp;</td>
<td align="left">
<div id="divCustomer1260" name="divCustomer1260"
style="position:absolute; width:188px; height:95px; z-index:2; top: 130px; visibility:hidden;">
<select name="lstCustomer1260" name="lstCustomer1260" id="lstCustomer1260" size="5"
onclick="fnclick2()" onChange="LoadValues2()" style = "width:491px;font-family:courier new">
<option Value = "INV">
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| ARG# &nbsp;&nbsp;&nbsp;&nbsp;| PRISM# | US/CA
</option>

</select>
</div>
</td>
</tr>
<%
 
This is just the code that is run when on of the boxes are selected.

Seems simple enough..

//When the text box recieves focus, the combo box should appear below it
function fnselect()
{
divCustomerGroup.style.visibility = 'visible';
document.frmOrderAssignment.txtCustomer.focus();
document.frmOrderAssignment.txtCustomer.select();
}

function fnselect2()
{
divCustomer1260.style.visibility = 'visible';
document.frmOrderAssignment.txtCustomer.focus();
document.frmOrderAssignment.txtCustomer.select();
}

also tried to put in this line in fnselect23

divCustomerGroup.style.visibility = 'invisible';
and its fine, but I don't understand why both boxes come up only for the fnselect2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top