Re: Searching for Nothing

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 20225
interpreted = N
texte = At 14:41 Uhr 03.10.1998, Howard Wolosky wrote:>What is the method taken to search for nothing in a field of a database? >I'm trying to do it based off of a form, but when I use a modified version >of the search form created by the database helper, if they type nothing >into the field, and select not equal to for the search type, it just >doesn't work. Any ideas?Formfields get submitted as they are. So if the user does not type anything, you get an empty value. Your searches for eqMYFIELDdata= or neMYFIELDdata= most likely do not return the right selection because in this cases you search definitely for empty or not-empty fields.If you have just a couple of fields you can avoid the search for empty fields within your search context: [hideif [myfield]=]&eqMYFIELDdata=[myfield][/hideif]If you deal with a lot of fields you should run through a [formvariables] loop first and set some variables based on the field values you get. Then build your search string or send the user a message to complete the form.Or use the required fields technique to reject empty fields, it is described in the manual. Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Associated Messages, from the most recent to the oldest:

    
  1. Re: Searching for Nothing (PCS Technical Support 1998)
  2. Re: Searching for Nothing (Martin Gertz Bech 1998)
  3. Re: Searching for Nothing (Peter Ostry 1998)
  4. Searching for Nothing (Howard Wolosky 1998)
At 14:41 Uhr 03.10.1998, Howard Wolosky wrote:>What is the method taken to search for nothing in a field of a database? >I'm trying to do it based off of a form, but when I use a modified version >of the search form created by the database helper, if they type nothing >into the field, and select not equal to for the search type, it just >doesn't work. Any ideas?Formfields get submitted as they are. So if the user does not type anything, you get an empty value. Your searches for eqMYFIELDdata= or neMYFIELDdata= most likely do not return the right selection because in this cases you search definitely for empty or not-empty fields.If you have just a couple of fields you can avoid the search for empty fields within your search context: [hideif [myfield]=]&eqMYFIELDdata=[myfield][/hideif]If you deal with a lot of fields you should run through a [formvariables] loop first and set some variables based on the field values you get. Then build your search string or send the user a message to complete the form.Or use the required fields technique to reject empty fields, it is described in the manual. Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Peter Ostry

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Code intermittently reverts to previous state (2000) Shopping problems with 2.1b3 acgi (1997) UPS Rate Tables (2002) Sorry WebCatalog server not running. (2002) stray LF character in the email (2003) Generating unique SKU from [cart] - Still Stumped... (1997) WebCatalog2 Feature Feedback (1996) [closeDataBase myDataBase.db] not working? (1997) Getting the domain of every request ... (2003) cookies and [returnraw] (1997) WC2b12: Yes, Formulas.db is for real (1997) # fields limited? (1997) Converting characters to numbers ... (1997) Re:Searching for ALL / empty form field (1997) choice of images (2000) BannerAds example (1998) Need relative path explanation (1997) Online reference (1997) Great product and great job ! (1997) Tea Room trouble (1997)