|
| |
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
Specify Width of drop down box - 2/15/2005 12:32:19
How do I do it? Here is my drop down box I wish to modify: <select NAME="DistrictManager" SIZE="1"> <option></option> <!--#include file="../../_fpclass/fpdbrgn1.inc"--> <option><%=FP_FieldHTML(fp_rs,"DistrictManager")%></option> <!--#include file="../../_fpclass/fpdbrgn2.inc"--> </select> I tried adding width="20" to the select statement but it wouldn't work...what is the correct html to change this? Thanks!
|
|
|
|
rdouglass
Posts: 9187 From: Biddeford, ME USA Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 12:42:29
I don't think you can; I think it's determined by the longest item in the list. You may be able to "pad" your list; something like: <option><%IF len(FP_Field(fp_rs,"DistrictManager")) < 20 THEN Response.write(FP_Field(fp_rs,"DistrictManager") & REPLICATE(" ",20-len(FP_Field(fp_rs,"DistrictManager")))) ELSE Response.write(FP_Field(fp_rs,"DistrictManager")) END IF%></option> That any help?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 12:58:15
That produces the following error: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'REPLICATE' /breaktime/clients/search.asp, line 491 Line 491 is Response.write("<option>" & F.Name & "</option>" & VbCrLf) which is in the middle of an array.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:04:20
Yup..doesn't make sense to me either :) Here is the code: <%
fp_sQry="SELECT DISTINCT DistrictManager FROM LocationData ORDER BY DistrictManager ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="BreakTimeEnterData"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="DistrictManager"
fp_sMenuValue="DistrictManager"
fp_sColTypes="&DistrictManager=202&"
fp_iDisplayCols=1
fp_fCustomQuery=True
BOTID=2
fp_iRegion=BOTID
%>
<select NAME="DistrictManager" SIZE="1">
<option></option>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<option><%IF len(FP_Field(fp_rs,"DistrictManager")) < 20 THEN Response.write(FP_Field(fp_rs,"DistrictManager") & REPLICATE(" ",20-len(FP_Field(fp_rs,"DistrictManager")))) ELSE Response.write(FP_Field(fp_rs,"DistrictManager")) END IF%></option>
<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</select></nobr></td>
</tr>
<tr>
<td colspan="5">
<p align="center"><b>Sorting</b></td>
</tr>
<tr>
<td><b><font size="2">Column</font></b></td>
<td colspan="4">
<%
DIM myDSN, myConn, mySQL, myTempRS, F
mySQL = "SELECT * FROM qrySortColumn"
myDSN = Application("BreakTimeEnterData_ConnectionString")
Response.write("<select size='1' name='SortColumn'><option></option>" & VbCrLf)
set myConn=server.createobject("adodb.connection")
myConn.open myDSN
set myTempRS=myConn.execute(mySQL)
For Each F In myTempRS.Fields
Response.write("<option>" & F.Name & "</option>" & VbCrLf)
Next
myTempRS.close
Set myTempRS = nothing
myConn.close
Set myConn = nothing
Response.write("</select>" & VbCrLf)
%>
That isnt' all of the code (too big) but that contains the option values and the array that the error came from.
|
|
|
|
rdouglass
Posts: 9187 From: Biddeford, ME USA Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:06:45
quote:
Response.write(FP_Field(fp_rs,"DistrictManager") & REPLICATE(" ",20-len(FP_Field(fp_rs,"DistrictManager")))) Try using STRING instead of REPLICATE. REPLICATE is an SQL Server only function I think. Sorry if I misled you... Response.write(FP_Field(fp_rs,"DistrictManager") & STRING(" ",20-len(FP_Field(fp_rs,"DistrictManager"))))
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:15:13
I get the following error: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'FP_Field(...)' /breaktime/clients/search.asp, line 491 Line 491 is: set myTempRS=myConn.execute(mySQL) So I tried this: <option><%DIM DistrictManager DistrictManager=FP_FieldHTML(fp_rs,"DistrictManager")%> <%IF len(DistrictManager) < 20 THEN Response.write(DistrictManager & STRING(" ",20-len(DistrictManager)))%> <%ELSE Response.write(DistrictManager)%> <% END IF%></option> and get the following error: Error Type: Microsoft VBScript compilation (0x800A03FB) Expected 'Loop' /breaktime/clients/search.asp, line 494 line 494 is myConn.open myDSN
|
|
|
|
rdouglass
Posts: 9187 From: Biddeford, ME USA Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:24:38
quote:
For Each F In myTempRS.Fields Response.write("<option>" & F.Name & "</option>" & VbCrLf) Next I think we're looking in the wrong place. Have you confirmed the query "SELECT * FROM qrySortColumn" returns any data?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:28:56
no luck..here is the code I have: <%DIM DistrictManager
DistrictManager=FP_FieldHTML(fp_rs,"DistrictManager")%>
<option><%IF (len(DistrictManager&"")) < 20 THEN Response.write(DistrictManager & STRING(" ",20-len(DistrictManager)))%>
<%ELSE Response.write(DistrictManager)%>
<%END IF%>
</option>
It produces this error: Error Type: Microsoft VBScript compilation (0x800A03FB) Expected 'Loop' /breaktime/clients/search.asp, line 495 Line 495 is: myConn.open myDSN
|
|
|
|
rdouglass
Posts: 9187 From: Biddeford, ME USA Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:34:12
quote:
<% DIM myDSN, myConn, mySQL, myTempRS, F mySQL = "SELECT * FROM qrySortColumn" myDSN = Application("BreakTimeEnterData_ConnectionString") Response.write("<select size='1' name='SortColumn'><option></option>" & VbCrLf) set myConn=server.createobject("adodb.connection") myConn.open myDSN set myTempRS=myConn.execute(mySQL) For Each F In myTempRS.Fields Response.write("<option>" & F.Name & "</option>" & VbCrLf) Next myTempRS.close Set myTempRS = nothing myConn.close Set myConn = nothing Response.write("</select>" & VbCrLf) %> Try commenting out all that code to see if the error actually is in that loop or the DRW. I suspect the error is not in the DWR, but this will rule it out one way or another....
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:38:16
I deleted that code in its entirety and it gives the same error...line 494 this time is: <input type="radio" name="ColumnFilter" value=" ASC">Ascending<br>
|
|
|
|
rdouglass
Posts: 9187 From: Biddeford, ME USA Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:48:52
quote:
<%DIM DistrictManager DistrictManager=FP_FieldHTML(fp_rs,"DistrictManager")%> <option><%IF (len(DistrictManager&"")) < 20 THEN Response.write(DistrictManager & STRING(" ",20-len(DistrictManager)))%> <%ELSE Response.write(DistrictManager)%> <%END IF%> </option> So if you make this section this : <option><%=FP_FieldHTML(fp_rs,"DistrictManager")%></option> does it now work? IOW is it really that section causing the prob?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 13:56:02
Yup, if I change it back to its original of <option><%=FP_FieldHTML(fp_rs,"DistrictManager")%></option> , then it displays all the results...just, not the specified width i'd like it to be.
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 14:32:47
Ahh, a dummy saying at the top...that would work pretty well for what I wish to accomplish. I find it wierd that this can't be done simply and it is so complicated to get it to to work...buy, hey, I didn't write the language :) Thanks for you ideas rdouglass..i'll put the dummy ones in and it will look great :)
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 14:36:22
well, this works: <option> </option> place as many of those bad boys as needed :)
|
|
|
|
dzirkelb1
Posts: 1300 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Specify Width of drop down box - 2/15/2005 15:12:52
sweetness...that does it a lot easier than adding the " "...thanks!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|