Re: [WebDNA] Non-numbers entered into a field that asks for a number

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101589
interpreted = N
texte = I have not. I may try that ... Thanks! Marc Thompson wrote: > Have you tried using JavaScript validation? > function isNumeric(elem, errMsg){ > var numericExpression = /^[0-9]+$/; > if(elem.value.match(numericExpression)){ > return true; > }else{ > alert(errMsg); > elem.focus(); > return false; > } > } > > Marc > > Ki Song wrote: >> 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). If >> a customer accidentally enters a letter, or any non-number, it looks >> like it converts that non-number to a random number. >> >> What is the best way to code the page so that the customer can't enter >> a non-number into the field? >> > Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Non-numbers entered into a field that asks for a number (Stuart Tremain 2008)
  2. Re: [WebDNA] Non-numbers entered into a field that asks for a number (Marc Thompson 2008)
  3. Re: [WebDNA] Non-numbers entered into a field that asks for a number (Govinda 2008)
  4. Re: [WebDNA] Non-numbers entered into a field that asks for a number (Ki Song 2008)
  5. Re: [WebDNA] Non-numbers entered into a field that asks for a number (Marc Thompson 2008)
  6. [WebDNA] Non-numbers entered into a field that asks for a number (Ki Song 2008)
I have not. I may try that ... Thanks! Marc Thompson wrote: > Have you tried using JavaScript validation? > function isNumeric(elem, errMsg){ > var numericExpression = /^[0-9]+$/; > if(elem.value.match(numericExpression)){ > return true; > }else{ > alert(errMsg); > elem.focus(); > return false; > } > } > > Marc > > Ki Song wrote: >> 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). If >> a customer accidentally enters a letter, or any non-number, it looks >> like it converts that non-number to a random number. >> >> What is the best way to code the page so that the customer can't enter >> a non-number into the field? >> > Ki Song

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:

[HIDEIF] inside [FOUNDITEM] (1997) WebCat2b13MacPlugIn - More limits on [include] (1997) WebCatalog for LinuxPPC/SusePPC? (2000) Logical and or in [hideif] (1997) Bug Report, maybe (1997) [WebDNA] Pretty URLS (2011) [search] within [listfiles]? (2003) WebDNA Developers' Network ---- Thank you (2002) Checkboxes (1997) [WebDNA] HTTP crashes (2010) A question on sub-categories (1997) bug in [SendMail] (1997) WebDNA for Dummies (2004) Extended [ConvertChars] (1997) exclusive db lock with webcat-3 ? (2000) displaying [cart] contents with a pull-down & frames (1998) Bug Report, maybe (1997) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) WebCatalog for Dummies part 2 (2000) WebCatalog 4.0 ? (2000)