[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

Frontpage Search ability

Is it possible to have 3 drop downs for search and only one search button on all web pages. ie. communities.htm, homes.htm, rentals.htm and etc.

1st. where you select the country.  Automatically picks states or provinces for each individual country, and inserts state or province in the next drop down. (I add the countries)

2nd. where you select the city, and if not the united states it would say province.  Automatically picks cities for each individual state or province, and inserts cities in the next drop down. (I add the states or provinces)

3rd. when city or province is selected, click on search, and all the items listed on each individual .htm are displayed. (I add the cities)

Thanks,

Ron

0
ronlcline
Asked:
ronlcline
  • 2
1 Solution
 
rbartzCommented:
Dynamically filling in form selects is best done with Javascript using "onchange" to fill the next select with options...  FrontPage does not have this ability by itself.

If the number of countries, states, and cities is large or subject to change, I would put the data in either MYSQL or flat file database tables and use a PHP page to build the javascript functions dynamcially, then include the javascript page in the HTML pages with an SSI include.

As long as you named the selects the same in all pages and the forms were the only forms (or at least the first form) on the form pages, you can fill those selects dynamically on all your form pages using that one PHP page to build the javascript.

I realize that if you are used to designing with FrontPage by itself, you are probably in trouble here.  However, advanced page features like you are suggesting need more than you can do in FrontPage alone.
0
 
ronlclineAuthor Commented:
I'm probably in trouble, or at least know what has to be done.

I am fimiliar with ms access tables and vb, can these be used in the same manner?

I have at present 15 .htm pages that will need to be searched seperately.

Aircraft
Automobiles
Art & Decor
Developers & Builders
Furniture
Finance
Home Theatre
Hotels
Insurance Brokers
Interior Design
Relocation
Landscapers
Pools & Spa
Travel
Yachts

If not, do you recommend anyone that can do this for me, and if not, close out this question and give yourself 500 points!



Thank you in advance,

Ron

0
 
Eme-EleonuCommented:
Let me assure you that FP can do all that Dreamweaver and the lot can... all that is needed is that you study your ASP, Java etc. Dreamwaever by its self can not do much too for instance this problem. Try this for a solution to your problem.

First thing first, save your page as .asp (Htm) wont do what we want. We have to create 3 separate forms on one page (with distict form names) put them alone in one page (searchpage.asp). Include them in other pages with <!-- #include file="searchpage.asp" --> in the place where you want them to appear on other pages.

<!-- For coutry dropdown -->
<% Set objDC = Server.CreateObject("ADODB.Connection")
objDC.Open Application("selfappraisal_connectionstring")
Set objRS = objDC.Execute("SELECT Country FROM Table")
%>

<FORM METHOD="POST" NAME="Form1">
      <SELECT NAME="Country" SIZE="1" ONCHANGE=Form1.submit()>
            <option selected><% = Request.Form("Country") %></option>
      <% ' Continue until we get to the end of the recordset.
      Do Until objRS.EOF
      ' For each record we create a option tag and set it's value to the Country
            %>
            <OPTION><%= objRS("Country") %></OPTION>
            <%
      ' Get next record
      objRS.MoveNext
      Loop
      %>
      </SELECT> <b><font face="Arial" size="2" >Choose Your Country</font></b></p>
      </FORM>
' Close Data Access Objects and free DB variables
objRS.Close
Set objRS =  Nothing
objDC.Close
Set objDC = Nothing
%>
<!-- End first Drop Down -->
<!--Second drop down -->
<% IF Request.Form("Country") = "" Then
Else
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.Open Application("selfappraisal_connectionstring")
Set objRS = objDC.Execute("SELECT distinct City FROM Table WHERE Country= '" & Request.Form("Country") & "'")
%>
      <FORM METHOD="POST" NAME="Form2">
      <SELECT NAME="City" SIZE="1" ONCHANGE=Form2.submit()>
            <option selected><% = Request.Form("City") %></option>
      <%
      ' Continue until we get to the end of the recordset.
      Do Until objRS.EOF
            ' For each record we create a option tag and set it's value to the city
            %>
            <OPTION><%= objRS("City") %></OPTION>
            <%
      ' Get next record
      objRS.MoveNext
      Loop
      %>
      <%
      'Set a hidden value in the second form for the Country
      'so we can pass it along with the city to the next query
      %>
</SELECT></font></b>
       <input type="hidden" name="Country" value="<% = Request.Form("Country") %>">
 </FORM>
<%
' Close Data Access Objects and free DB variables
objRS.Close
Set objRS =  Nothing
objDC.Close
Set objDC = Nothing
End IF
%>
<!-- Third dropdown -->
<% IF Request.Form("City") = "" Then
Else
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.Open Application("selfappraisal_connectionstring")

Set objRS = objDC.Execute("SELECT Province FROM Table WHERE City= '" & Request.Form("City") & "'")
%>
      <FORM METHOD="POST" NAME="Form3">
      <SELECT NAME="Province" SIZE="1" ONCHANGE=Form3.submit()>
            <option selected><% = Request.Form("Province") %></option>
      <%
      ' Continue until we get to the end of the recordset.
      Do Until objRS.EOF
            ' For each record we create a option tag and set it's value to the city
            %>
            <OPTION><%= objRS("Province") %></OPTION>
            <%
      ' Get next record
      objRS.MoveNext
      Loop
      %>
      <%
      'Set a hidden value in the second form for the Country and city so we can pass them along with the city to the next query
      %>
</SELECT></font></b>
       <input type="hidden" name="Country" value="<% = Request.Form("Country") %>">
       <input type="hidden" name="City" value="<% = Request.Form("City") %>">
 </FORM>
<%
' Close Data Access Objects and free DB variables
objRS.Close
Set objRS =  Nothing
objDC.Close
Set objDC = Nothing
End IF
%>

<!-- Finally to dispaly the result Display Category on display results page page --->
<% IF Request.Form("province") = "" Then
Else
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.Open Application("selfappraisal_connectionstring")

Set objRS = objDC.Execute("SELECT * FROM table WHERE province = '" & Request.Form("province") & "'")
%>

<!-- Your page content will then go here LIST ALL CATEGORIES --- -->
<font size="2"><%= objRS("Category") %></font><p>
<font size="2"><%= objRS("City") %></font>

<%
' Close Data Access Objects and free DB variables
objRS.Close
Set objRS =  Nothing
Set objRSS =  Nothing
objDC.Close
Set objDC = Nothing
End IF
%>

I hope this will help! One more thing you can consider is instead of creating 15 different pages for you can consider creating only one page that looks under each category based on the province submitted by the from, that way whenever you need to change somehting you do it only once (Its also a songle point of failure! :-) enjoy.

0
 
ronlclineAuthor Commented:
Question Resolved
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now