questions - multiple forms, setting a default list box selection

T

tg

Relatively new to FrontPage and can't seem to figure this out a couple of
issues...

1st issue:
- I have a single page with multiple forms. (these forms are named
"form1", "form2", etc.)
- each form contain list boxes, radio buttons, text boxes etc.
- I want the "submit" form to gather the current data and list box
selections within each of the other forms.
- question - how do I reference each item contained in each form, from
the "submit" form?
- I have attempted the following within the advanced hidden fields in
the "submit" form properties, with no success

<%=auto_type%>
<%=form1.auto_type%>
<%=Request("auto_type")%>
<%=Request("form1.auto_type")%>


The second issue:
- I have a list box containing an unknown number of items that may change
frequently
- I want to allow the user to specify text and have that item appear as the
first or highlight text item in a list box when another page is presented to
a user
- So I will know the text item but will not know where it is within the list
_ the text will always be in the list somewhere.

Here is a quick example:

- user selects "tree"
- on a second page a list contains 7 items - house, flower, driveway, tree,
plant, street, bush, bottom

another user may select "top"
- on second page a list may contain 10 items - bush, tray, auto, maple,
truck, motorcycle, shrub, tree, top, bottom

How do the proper text selected each time?

Thanks in advance for any help folks!!
 
D

David Berry

The first form would submit to the second form. On the second form you grab
the values you need from the first form and assign them to variables with:

<%
strFieldName = Request.Form("FieldName")
%>

Where FieldName is the name of the field, button, drop down etc on the first
form.

Then you would insert those variables into hidden fields that would then get
passed to the final script when submit is press on the second form. Ex:

<input type = "hidden" name="FieldName" value="<%strFieldName%>">
 
T

Thomas A. Rowe

Why not use a single form, since you have all the forms on a single page?

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
T

tg

The various forms contain drop down lists of data from database tables.
Along with other stuff, I was attempting to use the "onchange" function of
one list / form as the criteria for the database selection on the second
list / form - and third and fourth. The last form would have the final
"submit" button where I wanted to gather all the data from the various list
and text boxes from each previous form. I have most if this working now.

Any suggestion of how to force a list box to initially display a certain
item from it's list when that item is not the first item of the list?

Thanks.
 
S

Stefan B Rusynko

Don't make any of your dropdown fields as selected
Then based on some variable add code to all option fields to make that field the selected field
Say you have a variable
<% fruit=apples%>

Then in the dropdowns add

<option value="green" <%IF fruit=apples THEN%>selected<%END IF%>>green</option>
<option value="blue" <%IF fruit=apples THEN%>selected<%END IF%>>blue</option>

and so on
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| The various forms contain drop down lists of data from database tables.
| Along with other stuff, I was attempting to use the "onchange" function of
| one list / form as the criteria for the database selection on the second
| list / form - and third and fourth. The last form would have the final
| "submit" button where I wanted to gather all the data from the various list
| and text boxes from each previous form. I have most if this working now.
|
| Any suggestion of how to force a list box to initially display a certain
| item from it's list when that item is not the first item of the list?
|
| Thanks.
|
|
| | > Why not use a single form, since you have all the forms on a single page?
| >
| > --
| > ==============================================
| > Thomas A. Rowe
| > Microsoft MVP - FrontPage
| >
| > http://www.Ecom-Data.com
| > ==============================================
| >
| >
| > | >> Relatively new to FrontPage and can't seem to figure this out a couple of
| >> issues...
| >>
| >> 1st issue:
| >> - I have a single page with multiple forms. (these forms are named
| >> "form1", "form2", etc.)
| >> - each form contain list boxes, radio buttons, text boxes etc.
| >> - I want the "submit" form to gather the current data and list box
| >> selections within each of the other forms.
| >> - question - how do I reference each item contained in each form,
| >> from the "submit" form?
| >> - I have attempted the following within the advanced hidden fields in
| >> the "submit" form properties, with no success
| >>
| >> <%=auto_type%>
| >> <%=form1.auto_type%>
| >> <%=Request("auto_type")%>
| >> <%=Request("form1.auto_type")%>
| >>
| >>
| >> The second issue:
| >> - I have a list box containing an unknown number of items that may change
| >> frequently
| >> - I want to allow the user to specify text and have that item appear as
| >> the first or highlight text item in a list box when another page is
| >> presented to a user
| >> - So I will know the text item but will not know where it is within the
| >> list _ the text will always be in the list somewhere.
| >>
| >> Here is a quick example:
| >>
| >> - user selects "tree"
| >> - on a second page a list contains 7 items - house, flower, driveway,
| >> tree, plant, street, bush, bottom
| >>
| >> another user may select "top"
| >> - on second page a list may contain 10 items - bush, tray, auto, maple,
| >> truck, motorcycle, shrub, tree, top, bottom
| >>
| >> How do the proper text selected each time?
| >>
| >> Thanks in advance for any help folks!!
| >>
| >
| >
|
|
 
T

tg

Thanks for your reply however the list boxes are being created and populated
using the FrontPage database wizard, their contents are dynamic and unknown
until displayed, so I am not clear of how to interrogate each item as it's
being placed into the list.

I have looked at the drop down list properties and do see a "specify value"
check box that is defaulted to unchecked. I also see a value field that can
be altered if the check box is checked. The default formula in that value
field is <%=FP_FieldHTML(fp_rs,"color")%> . I do not know how for
incorporate the variable into that formula (I have replaced "color",
including the double quotes, with the variable name with no success), or how
to place the lines you described within the "<!--webbot bot" section.

The text item within the list box that I want to have initially displayed is
contained in a variable as:
selectedcolour = "red"
next time it could be set to "blue"

Thanks


Stefan B Rusynko said:
Don't make any of your dropdown fields as selected
Then based on some variable add code to all option fields to make that
field the selected field
Say you have a variable
<% fruit=apples%>

Then in the dropdowns add

<option value="green" <%IF fruit=apples THEN%>selected<%END
IF%>>green</option>
<option value="blue" <%IF fruit=apples THEN%>selected<%END
IF%>>blue</option>

and so on
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| The various forms contain drop down lists of data from database tables.
| Along with other stuff, I was attempting to use the "onchange" function
of
| one list / form as the criteria for the database selection on the second
| list / form - and third and fourth. The last form would have the final
| "submit" button where I wanted to gather all the data from the various
list
| and text boxes from each previous form. I have most if this working now.
|
| Any suggestion of how to force a list box to initially display a certain
| item from it's list when that item is not the first item of the list?
|
| Thanks.
|
|
| | > Why not use a single form, since you have all the forms on a single
page?
| >
| > --
| > ==============================================
| > Thomas A. Rowe
| > Microsoft MVP - FrontPage
| >
| > http://www.Ecom-Data.com
| > ==============================================
| >
| >
| > | >> Relatively new to FrontPage and can't seem to figure this out a
couple of
| >> issues...
| >>
| >> 1st issue:
| >> - I have a single page with multiple forms. (these forms are named
| >> "form1", "form2", etc.)
| >> - each form contain list boxes, radio buttons, text boxes etc.
| >> - I want the "submit" form to gather the current data and list box
| >> selections within each of the other forms.
| >> - question - how do I reference each item contained in each form,
| >> from the "submit" form?
| >> - I have attempted the following within the advanced hidden fields
in
| >> the "submit" form properties, with no success
| >>
| >> <%=auto_type%>
| >> <%=form1.auto_type%>
| >> <%=Request("auto_type")%>
| >> <%=Request("form1.auto_type")%>
| >>
| >>
| >> The second issue:
| >> - I have a list box containing an unknown number of items that may
change
| >> frequently
| >> - I want to allow the user to specify text and have that item appear
as
| >> the first or highlight text item in a list box when another page is
| >> presented to a user
| >> - So I will know the text item but will not know where it is within
the
| >> list _ the text will always be in the list somewhere.
| >>
| >> Here is a quick example:
| >>
| >> - user selects "tree"
| >> - on a second page a list contains 7 items - house, flower, driveway,
| >> tree, plant, street, bush, bottom
| >>
| >> another user may select "top"
| >> - on second page a list may contain 10 items - bush, tray, auto,
maple,
| >> truck, motorcycle, shrub, tree, top, bottom
| >>
| >> How do the proper text selected each time?
| >>
| >> Thanks in advance for any help folks!!
| >>
| >
| >
|
|
 
S

Stefan B Rusynko

So your dropdown field would be (below is all on 1 line)

<option value="<%=FP_FieldHTML(fp_rs,"color")%>" <%IF<%=FP_FieldHTML(fp_rs,"color")%>="red"
THEN%>selected<%END IF%>><%=FP_FieldHTML(fp_rs,"color")%></option>




| Thanks for your reply however the list boxes are being created and populated
| using the FrontPage database wizard, their contents are dynamic and unknown
| until displayed, so I am not clear of how to interrogate each item as it's
| being placed into the list.
|
| I have looked at the drop down list properties and do see a "specify value"
| check box that is defaulted to unchecked. I also see a value field that can
| be altered if the check box is checked. The default formula in that value
| field is <%=FP_FieldHTML(fp_rs,"color")%> . I do not know how for
| incorporate the variable into that formula (I have replaced "color",
| including the double quotes, with the variable name with no success), or how
| to place the lines you described within the "<!--webbot bot" section.
|
| The text item within the list box that I want to have initially displayed is
| contained in a variable as:
| selectedcolour = "red"
| next time it could be set to "blue"
|
| Thanks
|
|
| | > Don't make any of your dropdown fields as selected
| > Then based on some variable add code to all option fields to make that
| > field the selected field
| > Say you have a variable
| > <% fruit=apples%>
| >
| > Then in the dropdowns add
| >
| > <option value="green" <%IF fruit=apples THEN%>selected<%END
| > IF%>>green</option>
| > <option value="blue" <%IF fruit=apples THEN%>selected<%END
| > IF%>>blue</option>
| >
| > and so on
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > | > | The various forms contain drop down lists of data from database tables.
| > | Along with other stuff, I was attempting to use the "onchange" function
| > of
| > | one list / form as the criteria for the database selection on the second
| > | list / form - and third and fourth. The last form would have the final
| > | "submit" button where I wanted to gather all the data from the various
| > list
| > | and text boxes from each previous form. I have most if this working now.
| > |
| > | Any suggestion of how to force a list box to initially display a certain
| > | item from it's list when that item is not the first item of the list?
| > |
| > | Thanks.
| > |
| > |
| > | | > | > Why not use a single form, since you have all the forms on a single
| > page?
| > | >
| > | > --
| > | > ==============================================
| > | > Thomas A. Rowe
| > | > Microsoft MVP - FrontPage
| > | >
| > | > http://www.Ecom-Data.com
| > | > ==============================================
| > | >
| > | >
| > | > | > | >> Relatively new to FrontPage and can't seem to figure this out a
| > couple of
| > | >> issues...
| > | >>
| > | >> 1st issue:
| > | >> - I have a single page with multiple forms. (these forms are named
| > | >> "form1", "form2", etc.)
| > | >> - each form contain list boxes, radio buttons, text boxes etc.
| > | >> - I want the "submit" form to gather the current data and list box
| > | >> selections within each of the other forms.
| > | >> - question - how do I reference each item contained in each form,
| > | >> from the "submit" form?
| > | >> - I have attempted the following within the advanced hidden fields
| > in
| > | >> the "submit" form properties, with no success
| > | >>
| > | >> <%=auto_type%>
| > | >> <%=form1.auto_type%>
| > | >> <%=Request("auto_type")%>
| > | >> <%=Request("form1.auto_type")%>
| > | >>
| > | >>
| > | >> The second issue:
| > | >> - I have a list box containing an unknown number of items that may
| > change
| > | >> frequently
| > | >> - I want to allow the user to specify text and have that item appear
| > as
| > | >> the first or highlight text item in a list box when another page is
| > | >> presented to a user
| > | >> - So I will know the text item but will not know where it is within
| > the
| > | >> list _ the text will always be in the list somewhere.
| > | >>
| > | >> Here is a quick example:
| > | >>
| > | >> - user selects "tree"
| > | >> - on a second page a list contains 7 items - house, flower, driveway,
| > | >> tree, plant, street, bush, bottom
| > | >>
| > | >> another user may select "top"
| > | >> - on second page a list may contain 10 items - bush, tray, auto,
| > maple,
| > | >> truck, motorcycle, shrub, tree, top, bottom
| > | >>
| > | >> How do the proper text selected each time?
| > | >>
| > | >> Thanks in advance for any help folks!!
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 

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