Can more than 2 values be set from a single dropdown?

D

Dave

I have a dropdown that I want the user to see information side by side. I
have created that. When the user selects the appropriate information ID is
passed. Can the dropdown pass 2 values with a single selection? The
dropdown is populated from database records.

<select NAME="ClassID" SIZE="1"><option
VALUE="<%=FP_FieldHTML(fp_rs,"ID")%>"><%=FP_FieldHTML(fp_rs,"Class")%<%=FP_F
ieldHTML(fp_rs,"Date")%></option></select>

Thanks

Dave
 
T

Thomas A. Rowe

In general no, however to do so you would have to combine the value into one, then on the page
receiving the value you would have to split the value back into individual values. But in order to
split the values, both values must always be a set number of characters.


<%=FP_FieldHTML(fp_rs,"Date")%></option></select>


Next page

Dim ClassID1
ClassID1 = Request.Form("ClassID")

ID = Left(ClassID1,6)
Date = Right(ClassID,8)

Note: Date is a reserved word, rename your field.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
J

Jon Spivey

I'd use some character to seperate the 2 values so you might have

<option value="some value|some other value">
and then split them

<%
aTemp = split(request("dropdown"), "|")
strvalue1 = aTemp(0)
strvalue1 = aTemp(1)
%>
 
T

Thomas A. Rowe

Jon,

Great alternative, for what Dave want to do.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Dave

I am half way there. I passed 2 values as your option line suggested.

But I can't split them I get a page error.

The dropdown is called CLASSID I assume that goes where "dropdown" is below.

Where does the code go on the confirm page? I have tried the Body, Head,
above the Head all return error messages.

Thanks
 
T

Thomas A. Rowe

Slight mod to Jon code, place above the opening <html> tag:

<%
aTemp = split(request.form("CLASSID"), "|")
ClassID = aTemp(0)
ClassDate = aTemp(1)
%>


The to display in the body of the page:

<%=ClassID%>

<%=ClassDate%>



--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Dave

The dropdown was created using the Results wizard - does that matter?
I tried using <%=ClassID%> to show the ClassID which is the name of the
dropdown and I do not get results.

Are webbots playing into this issue? I can see the joined field names
using the Confirmation Field entry for ClassID.

Don't give up on me yet.

Dave
 
T

Thomas A. Rowe

Somewhere on your page after the code below, add:

<%=aTemp%>

so that you can see if aTemp actually has a value.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

I don't use the FP database components, but that shouldn't matter in this case.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
D

Dave

Ok here is what I did

Above the <HTML> I have
<%
aTemp=request.form("ClassID")
%>

under the <Body> Tag

I have <%=aTemp%>

I do not get a return for the <%=aTemp%>

I do get a return for the webbot ClassID Confirmation Field.

The submit page writes to the database and the confirmation page is just
that - a formatted confirmation page.

Thanks
 
T

Thomas A. Rowe

Sound like you are doing everything correctly, and maybe this is a issue of use the FP database
component, which I don't use.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
J

Jon Spivey

Hi Dave,

aTemp is an array - you can't response.write an array, which makes sense
when you think about it. You can do
<%=aTemp(0)%>
or
<%=aTemp(1)%>
or
<%=ubound(aTemp)%>
which would give the answer 1
but not
<%=aTemp%>

To see what I mean see what happens when you run this code
<%
aTemp = array(1,2,3)
response.write aTemp
%>
and then try
<%
aTemp = array(1,2,3)
response.write aTemp(0) ' returns 1
%>
 
T

Thomas A. Rowe

Jon,

I didn't even consider that was an Array!

I avoid arrays, unless there is no other means of doing something.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top