Once again, you are making it possible to revise and test the new SQL statement, the one that will process the data submitted by the form.Ĭhange only the WHERE clause in the statement so that it reads as follows:ĪSP users: WHERE tbl_untryName='"& Request.Form("tourCountry") & "'ĬoldFusion users: WHERE tbl_untryName='#form.tourCountry#'įor the most part, this version of the query should make sense to you. Copy the second query and paste it on the next line. Find the two queries (one should be commented out). Don't press Submit, though, or you will get an error, because tour_detail.asp is expecting a URL variable called regionid, not a form variable called countryName. If you like, you can save and test the page in a browser, just to make sure that the menu is actually populated with country names. When the user clicks Submit, tour_detail.asp will load (that was specified in the form's action attribute), and the name-value pair tourCountry=Argentina (or whichever country the user selected) will be sent as a form variable. When the page is displayed in a browser, the country names will populate the menu in alphabetical order. You've done this before, so the consequence of these steps should not be a mystery. Leave the Values and Labels at the default, countryName, and click OK. Select rs_countries from the Options From Recordset menu. Click the Dynamic button to open the Dynamic List/Menu dialog. You'll use this to build the drop-down menu in the form.Ĭlick to select the menu, and in the Property inspector, name it tourCountry. If you press the Test button, you'll see that this recordset produces a list of all the countries in tbl_country in alphabetical order. Use the Bindings panel to create a new recordset, using the following settings: Of course, you still have to configure its elements, most notably, the menu element. These settings apply to the form as a whole, and it is now ready to use. Select the tag in the tag selector, and use the Property inspector to name the form frm_bycountry. You should at this point be comfortable mocking up form elements on the page. Open tours.asp in design view, position the insertion point in the second row of the right-hand column, and insert a form with one list/menu element and a Submit button. As before, you'll create a new SQL statement to handle this filtering method. Rather than working with links and URL parameters, you will work with a form and form variables. Implementing the search by country is similar, with a few variations. You have implemented the full functionality of the search by region.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |