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:

WC2f3 (1997) simple [convertChars] Q (2000) [/application] error? (1997) Mac Vs WindowsNT (1997) RequiredFields template (1997) founditem align (1998) [WebDNA] XML error? (2015) Counting LineItems (2000) ErrorMessages.db suggestion (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) Getting total number of items ordered (1997) Searching for words equal to A or equal to B (1999) selling? (2001) [SHOWIF AND/OR] (1997) Multiple security dbs (1997) Central Reservation System? (2003) WebDNA Solutions ... sorry! (1997) Suggestions on best way to work with yyyy/mm/dd (1997) RE: automatic reload of frameset (1997) New public beta available (1997)