navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Specify Width of drop down box

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Microsoft FrontPage Help >> Specify Width of drop down box
Page: [1]
 
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.

(in reply to dzirkelb1)
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.

(in reply to rdouglass)
rdouglass

 

Posts: 9187
From: Biddeford, ME USA
Status: offline

 
RE: Specify Width of drop down box - 2/15/2005 13:02:10   
quote:

Line 491 is Response.write("<option>" & F.Name & "</option>" & VbCrLf)


I don't see REPLICATE in that line. :) Can you post the code you're using?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dzirkelb1)
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.

(in reply to rdouglass)
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.

(in reply to rdouglass)
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

(in reply to rdouglass)
rdouglass

 

Posts: 9187
From: Biddeford, ME USA
Status: offline

 
RE: Specify Width of drop down box - 2/15/2005 13:19:58   
quote:

IF len(DistrictManager) < 20 THEN


I give it one more quick shot before I load up your code.:)

IF (len(DistrictManager&"") < 20 THEN

If it's Null, let's force it to an empty string. That's what I'd try next anyways.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dzirkelb1)
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.

(in reply to rdouglass)
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

(in reply to rdouglass)
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.

(in reply to dzirkelb1)
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>

(in reply to rdouglass)
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.

(in reply to dzirkelb1)
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.

(in reply to rdouglass)
rdouglass

 

Posts: 9187
From: Biddeford, ME USA
Status: offline

 
RE: Specify Width of drop down box - 2/15/2005 14:22:46   
Well I was able to padd the items with spaces doing this:

<!--#include file="_fpclass/fpdbrgn1.inc"-->
<option><%IF len(FP_Field(fp_rs,"UserName")) < 100 THEN Response.write(FP_Field(fp_rs,"UserName") & STRING(100-len(FP_Field(fp_rs,"UserName"))," ")) ELSE Response.write(FP_Field(fp_rs,"UserName")) END IF%></option>
<!--#include file="_fpclass/fpdbrgn2.inc"-->

I have no idea why your's doesn't; it seems as tho it should.

with a DRW I put together. However, my browser seems to "trim" those entries so the dropdown doesn't expand. :)

My only other suggestion would be to put a "dummy" entry at the top or bottom with something like:

<option>Please Select One --</option>

(I think there was 20 characters there.) Even if i put a char at the end of my padding, the browser removed all but one between any characters when displaying.:)

Sorry I wasn't much help.



_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dzirkelb1)
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 :)

(in reply to rdouglass)
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 :)

(in reply to dzirkelb1)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Specify Width of drop down box - 2/15/2005 14:37:22   
Use a style to control the width :)

eg : <select style="width:100px">


eg : <select style="width:200px">


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to dzirkelb1)
rdouglass

 

Posts: 9187
From: Biddeford, ME USA
Status: offline

 
RE: Specify Width of drop down box - 2/15/2005 14:50:38   
When in doubt, ask Spooky!:)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Spooky)
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!

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> Microsoft FrontPage Help >> Specify Width of drop down box
Page: [1]
Jump to: 1





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