Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

FrontPage - Drop box

Posted on 2003-03-11
20
Medium Priority
?
321 Views
Last Modified: 2013-12-24
In FrontPage, I need to program a single web page with 2 drop boxes:

1. Choose Country
2. Choose Town

After which the relevant name and address of a customer is returned to an area on the same page.

Can this be coded using only HTML.?
0
Comment
Question by:thehaze
  • 7
  • 4
  • 4
  • +3
20 Comments
 
LVL 14

Expert Comment

by:hhammash
ID: 8114501
Hi,

1- Create a form
2- Insert Drop Down and name it Country
3- Insert Drop Down and name it Town
4- Give the values for Country
5- Give the values for Town
(The values can be setup by double clicking the Country drop down,  Name it Country, then click add and add your Option name and the value - Note the value is the value that is essential for the search)

Do the same for the Town Drop down.

Save your form as Search.asp

In Frontpage again
1- Create a new page
2- Go to Insert/Database Results
3- Select the database,  Next
4- Select the Record Source (Table)
5- Next
6- Click More Options
7- Click Criteria
8- Select Country=Country
9- Select Town=Town
10- Next until you reach step 5/5
11- Click Display all record
12- Uncheck Add search form then Click finish
13- Save your page as Results page
14- Go back to your Search.asp and open it
15- Right click inside the form and select form properties
16- Click Options
17- In the Action box type Results.asp
18- OK
19- Save your form

Test it.

Note in the values of the Dro down boxes you have to put the names of the Countries and cities as they are in the database.

Regards
hhammash
0
 

Author Comment

by:thehaze
ID: 8114571
Can this be done without using ASPs.?
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8114579
Hi,

Yes without ASP Programming.

Just through FrontPage.

But If you mean that you don't want .asp extension it can not be.

Regards
hhammash
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 19

Expert Comment

by:webwoman
ID: 8114668
Well, yes it COULD possibly be without ASP... but there's a lot of info needed that you haven't supplied.

>>1. Choose Country
2. Choose Town

After which the relevant name and address of a customer is returned to an area on the same page.
>>

You have only ONE customer per town/country? Or many? How do you have them stored now? Do you have a database?

Regardless, you CANNOT do what you asked with only HTML. Some type of scripting is required -- whether you use a FP wizard, write your own, do it on the client or the server -- you still need something more than HTML.

And without knowing all the info needed, we can't really give any good answer.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8114761
Hi,

Your Search form can be HTM, but the results should be a Database Results and as I mentioned above,  you will only need FrontPage and MS Access to accomplish this. It is a very simple database function.

If your host supports ASP you can do it very easily.

Best regars
hhammash
0
 

Author Comment

by:thehaze
ID: 8117251
My host does not support asp. I was thinking more along the lines of using a drop box:
1. First to select Country.
2. After which the contents of the 'Town' dropbox are determined from the choice of country.

This being a mixture of drop boxes and htm's.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8118681
Hi,

What you need is called Dynamic Drop Down,  you will need ASP.

Since your host does not support ASP.  You can make it in PHP and MySQL.

Go to this Forum (it is good) register and post your question:
http://www.php-forum.com/p/index.php

Or can go here in Expert-Exchange site and post the question in the PHP forum.

This is the forum:
http://www.experts-exchange.com/Web/Web_Languages/PHP/

Best regards
hhammash
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8123106
It can be done in HTML/JavaScript only, and doesn't require ASP. It does, however, require a lot more work...

You first form selects the country, which you use to decide what "Town" page to open using JavaScript.

Then build several pages with the appropraite list of towns in the drop-down.

Like I said, it can be done, but not very efficiently...

CR

0
 

Author Comment

by:thehaze
ID: 8126784
How can it be done using only HTML/JavaScript:?  
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8129883
Create a country page based on the following example. Then build all the various pages you need for each country with the appropriate towns in a drop down.

<html>

<head>
<title>Countries</title>
</head>

<body>

<script Language="JavaScript" Type="text/javascript">

<!--
function FormValidator(theForm)
{

  if (theForm.Country.selectedIndex == 0)
  {
    alert("The first \"Country\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.selectedIndex == 1)
  {
    window.open("USA.htm");
    return (false);
  }

  if (theForm.Country.selectedIndex == 2)
  {
    window.open("GB.htm");
    return (false);
  }

  if (theForm.Country.selectedIndex == 3)
  {
    window.open("CN.htm");
    return (false);
  }

  return (true);
}

//-->
</script>

<form method="POST" post="countries.htm" onsubmit="return FormValidator(this)" language="JavaScript" name="Form1">

  <p>
  <select size="1" name="Country">
    <option value="0">-Select One-</option>
    <option value="USA">USA</option>
    <option value="GB">Great Britain</option>
    <option value="CN">Canada</option>
  </select>
  <input type="submit" value="Submit" name="Submit">
  <input type="reset" value="Reset" name="Reset">
  </p>
</form>
&nbsp;


</body>

</html>
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8129964
Hi,

thehaze want to select a country then a city and when he/she submits the form he/she wants other data to be displayed

Quote
After which the relevant name and address of a customer is returned to an area on the same page
End Quote

If he/she just want to select and option from the drop down and go to the URL he/she can use the Jump Menu.

From what I understood he will required databases. It should be PHP since his/her host does not support ASP.

thehaze,  try and post this problem in the PHP forum, you might get an answer.

hhammash
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8130086
If thehaze has to stay on the same page, just do a document write of the Towns drop down instead...

Still, no database needed...

Still all in JS and HTML, no ASP OR PHP needed.

And, BTW, isn't a Jump Menu just a select form with the appropriate JavaScript to jump from one page to the next... like what I shared with thehaze.

Of course, mine wasn't generated by DreamWeaver.

CR
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8130347
Hi,

I know that the code was not generated by DreamWeaver,  and your code does the same, my question was How to display related Address with JavaScript.

The question is:
----------------

Where can he store Coutnries and Cities and Customer information and how to retrieve them?

CR,
I am asking not because I want to show that it can not be done, but because I would like to know.

How can you modify your code to display related information.

CR I am not criticizing your code, on the contrary I would like to see how can this be done without a DB. Sorry if you felt angry from my post.  I did not mean anything.


Thank you CR
hhammash
0
 
LVL 19

Expert Comment

by:webwoman
ID: 8133846
He can store the info in a js file -- create an array, and use that. If it's a separate .js file, you can even have multiple versions with only ONE processing module/.js file. I've done this, it works very well.

And you can have the dropdown be populated by the javascript, based on the selection from the first dropdown. Again, no database required and no reloading of the page. It's a bit tricky though.
0
 
LVL 4

Expert Comment

by:CRagsdell
ID: 8135949
webwoman,

Thanks for helping answer hhammash's question.

It IS possible with no PHP or ASP, but a heck of a lot easier with a database-driven system.

CR
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8135991
Hi CRgagsdell and Webwoman,

It is good that it can be done without Databases.
But you did not yet show thehaze how to do that and what is involved if he/she has hundreds of URLs and record.  Also you did not mention the volume of data that can be stored in a JS file and how to manipulate them in terms or sorting, searching ...etc.

I would like to see that too.


Thank you for your replies
hhammash
0
 

Author Comment

by:thehaze
ID: 8136319
I have 4 countries. For each country there are 10-15 towns.

How is this information stored in the one JS file, without a database and no reloading of the page.?
For example:
England --> London
            Manchester
            Liverpool --> Smith Ltd.
                          Jones Ltd.
0
 
LVL 29

Expert Comment

by:coreybryant
ID: 8989252
in the <HEAD>

<script language="JAVASCRIPT">
var browser_type=navigator.appName

var englandArray = new Array("London", "Manchester")
var liverpooleArray = new Array("Smith LTD", "Jones LTD")

function updateList(theForm, catName, subjListLength){
    for (var i=subjListLength + 1 ; i > 0 ; i-- )
    {
      theForm.Subject.options[i] = null
    }
      if( catName == "None"){
            var option0 = new Option("- Please Choose a Category Above -", "None")
      }
      else{
            eval('var option0 = new Option("- Please Choose -", "None")')
      }
      
       NSL=0
    if (catName != "None") {
          eval("var NewSource = " + catName +"Array")
          NSL = NewSource.length
              for(var L = 0; L < NSL + 1; L++)  {
             eval("var option" + [L + 1] + " = new Option(" + '"' + NewSource[L] + '", "' + NewSource[L] + '")')
             }
    }
    for (var i=0; i < NSL + 1; i++) {
            eval("theForm.Subject.options[i]=option" + i)
        if (i==0) {
         theForm.Subject.options[i].selected=true
        }
    }
if (browser_type=="Netscape")
   { history.go(0) }
}
</script>

And then in the <BODY>:

                      <select name="Category" size="1" onChange="updateList(this.form, this.options[selectedIndex].value, this.form.Subject.length)">
                        <option value="None"  Selected >- Please Choose - </option>
                        <option value="england" >England </option>
                        <option value="liverpoole" >Liverpoole </option>
                      </select>

                      <select name="Subject" id="Subject">
                        <option value="None" SELECTED>- Please Choose a Category  Above - </option>
                      </select>


That is if I understand the question correctly.  If not please either accept an answer or request it be deleted.  

Thank you!
-Corey
0
 
LVL 29

Expert Comment

by:coreybryant
ID: 9151230
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ / No Refund
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

coreybryant
EE Cleanup Volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9213642
Question is PAQ'd and no points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question