Re: [WebDNA] Non-numbers entered into a field that asks for a
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 101609
interpreted = N
texte = >> "Gary Krockover"
wrote:>> Again - isn't this exactly what a list-menu is for?Oh wait, I misunderstood hehe. To your point, Gary, I don't think a list-=menu would be appropriate=20in the case of the OP's situation:>> On our add to cart form, we have a text field that requires a customer= to enter the quantity of an item (it defaults to a quantity of 1)...what if someone wanted to order a quantity that was larger than the hig=hest value in the=20list-menu? What if some joker bypassed the form completely and hit the su=bmission-page with vars=20in the URL (ie. "blah.com?user_input_field=3D" or=20"blah.com?user_input_field=3DnonNumericCharacters"), or POSTED to the pag=e with vars... etc.Just sayin :p :-)-DanOn Wed, 10 Dec 2008 15:37:57 -0800 "Dan Strong" wrote:> Thanks, Gary, but I think the code I based that on originally came from= Charles Kline. I can't=20>remember anymore, it's been so long. On that note, I was credited with t=he "random password=20>generator" code on WebDNA.us (which is similar to this, but again, it or=iginally came from=20>someone else, Kline I think. At any rate, yes this is exactly what makes= this list so great and=20>durable.> -Dan>=20>=20>=20> On Wed, 10 Dec 2008 14:51:53 -0800> "Gary Krockover" wrote:>> Again - isn't this exactly what a list-menu is for?>>=20>> (nice code Dan - just saying....)>>=20>> GJK>>=20>> On Wed, 10 Dec 2008 14:41:56 -0800>> "Dan Strong" wrote:>>> This is a longer, less elegant way, but for archive sake=20>>>here's an alternative:>>>=20>>> ---------------------------------->>> [text]goodChars=3D1234567890[/text]>>> [text]inputLength=3D[countchars][user_input_field][/countchars][/text=]>>> [loop start=3D1&end=3D[inputLength]]>>> [text]x=3D[getchars=20>>>start=3D[index]&end=3D[index]][user_input_field][/getchars][/text]>>> [hideif [goodChars]^[x]]>>> Bad Character ([redirect] back to form w/error or=20>>>whatever)>>> [/hideif]>>> [/loop]>>> ---------------------------------->>>=20>>> I just did this off the top of my head, so it's=20>>>untested, but I've successfully used similar code in the=20>>>past.>>> -Dan>=20>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/
Associated Messages, from the most recent to the oldest:
>> "Gary Krockover" wrote:>> Again - isn't this exactly what a list-menu is for?Oh wait, I misunderstood hehe. To your point, Gary, I don't think a list-=menu would be appropriate=20in the case of the OP's situation:>> On our add to cart form, we have a text field that requires a customer= to enter the quantity of an item (it defaults to a quantity of 1)...what if someone wanted to order a quantity that was larger than the hig=hest value in the=20list-menu? What if some joker bypassed the form completely and hit the su=bmission-page with vars=20in the URL (ie. "blah.com?user_input_field=3D" or=20"blah.com?user_input_field=3DnonNumericCharacters"), or POSTED to the pag=e with vars... etc.Just sayin :p :-)-DanOn Wed, 10 Dec 2008 15:37:57 -0800 "Dan Strong" wrote:> Thanks, Gary, but I think the code I based that on originally came from= Charles Kline. I can't=20>remember anymore, it's been so long. On that note, I was credited with t=he "random password=20>generator" code on WebDNA.us (which is similar to this, but again, it or=iginally came from=20>someone else, Kline I think. At any rate, yes this is exactly what makes= this list so great and=20>durable.> -Dan>=20>=20>=20> On Wed, 10 Dec 2008 14:51:53 -0800> "Gary Krockover" wrote:>> Again - isn't this exactly what a list-menu is for?>>=20>> (nice code Dan - just saying....)>>=20>> GJK>>=20>> On Wed, 10 Dec 2008 14:41:56 -0800>> "Dan Strong" wrote:>>> This is a longer, less elegant way, but for archive sake=20>>>here's an alternative:>>>=20>>> ---------------------------------->>> [text]goodChars=3D1234567890[/text]>>> [text]inputLength=3D[countchars][user_input_field][/countchars][/text=]>>> [loop start=3D1&end=3D[inputLength]]>>> [text]x=3D[getchars=20>>>start=3D[index]&end=3D[index]][user_input_field][/getchars][/text]>>> [hideif [goodChars]^[x]]>>> Bad Character ([redirect] back to form w/error or=20>>>whatever)>>> [/hideif]>>> [/loop]>>> ---------------------------------->>>=20>>> I just did this off the top of my head, so it's=20>>>untested, but I've successfully used similar code in the=20>>>past.>>> -Dan>=20>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/
"Dan Strong"
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:
WC2.0 Memory Requirements (1997)
Re[3]: 2nd WebCatalog2 Feature Request (1996)
[format 40s]text[/format] doesn't work (1997)
2.0Beta Command Ref (can't find this instruction) (1997)
Running _every_ page through WebCat ? (1997)
Shownext never shows next...still (1997)
HTTP Header info (1997)
Multiple fields on 1 input (1997)
[math] are you there? (1999)
WebCat2 several catalogs? (1997)
PCS Frames (1997)
Getting total number of items ordered (1997)
Re:Help name our technology! (1997)
rn (range) (2003)
Email Formatting and Encryption (1998)
Banners (1997)
Car Database - Imporant (2002)
auto-stripping of spaces (1997)
Sorta OT: Printing From Browser Window (2001)
WC 2.0 frames feature (1997)