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 typeanything, you get an empty value. Your searches for eqMYFIELDdata= orneMYFIELDdata= most likely do not return the right selection because inthis cases you search definitely for empty or not-empty fields.If you have just a couple of fields you can avoid the search for emptyfields 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. Thenbuild your search string or send the user a message to complete the form.Or use the required fields technique to reject empty fields, it isdescribed in the manual.Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-8777454 fax ++43-1-8777454-21
Associated Messages, from the most recent to the oldest:
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 typeanything, you get an empty value. Your searches for eqMYFIELDdata= orneMYFIELDdata= most likely do not return the right selection because inthis cases you search definitely for empty or not-empty fields.If you have just a couple of fields you can avoid the search for emptyfields 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. Thenbuild your search string or send the user a message to complete the form.Or use the required fields technique to reject empty fields, it isdescribed in the manual.Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++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:
WebCat2.0 [format thousands .0f] no go (1997)
international time (1997)
Any Unix/Linux version to come? (1999)
check out page (SSL) not loading on Netscape 4.0+ - fixed? (1999)
Bug Report, maybe (1997)
unable to launch acgi in WebCat (1997)
Card clearance, problems - solutions? (1997)
Non HTML file protection - OS X (webstar or apache) (2002)
placement of ? (2000)
POSTing to a secure server ... (2000)
Quit revisited (1997)
Limiting user access to .tmpl files (1997)
Car Database (2002)
Loop into field (1998)
Digest Version (2000)
Date Sorting (1997)
WebCat2b15MacPlugin - showing [math] (1997)
shipcost vs shiptotal (1998)
Database Updates (1997)
[WebDNA] What version of linux (2009)