NETBUYS.com 

 

FrontPage98 Tips 

 

20. Deal with form field defaults 

Some of the more advanced database integration features in FrontPage require you to use Form Field Parameters in your queries. In this case, the query is run after a user enters some information into a form field and clicks the Submit button. But what if one of your visitors hits the Submit button without entering any information first? 

You can get around this by specifying a default for any Form Field Parameter required by a query. Simply open the page that contains the database components in the FrontPage Editor and switch over to the HTML view. Now find this part of the code:
<!--webbot bot="DatabaseRegionStart" 
and scan the list of associated attributes until you see s-DefaultFields. All you have to do is type in the name of the Form Field Parameter required by your query, an equal sign, and a default value. Running the page plugs that value into your query. 

For example, if the query is "Select * from customers" where LastName = '%%MyForm%%', in HTML view you could modify the s-DefaultFields attribute to read s-DefaultFields="MyForm=Johnson". If someone submits the form without first entering any data in the MyForm field, FrontPage will substitute in the value "Johnson" and then run the query. 

Related tips:
Turn delimited data into a table 
Customize the No Records Returned message 
Learn FrontPage's database features 
Format database bots 

IntroductionPreviousNext 

 
BACK TO NETBUYS
email NetBuyssm.
Any Comments? Please Call: 800-634-9518
Internet Link Exchange
Member of the Internet Link Exchange
Copyright © 1998 Netbuys. All rights reserved.
Revised: October 14, 1998.