• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is wrong with my validation code ?

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all:
Just wondering if someone could possibly take a look at my validation code here


The thing is though: EVEN IF ENTER NOTHING in the "amount" field, the form will still get processed, I then put an alert() in the code like
alert(frm.amount.value); an alert box popped up, but the alert box doesn't dipslay any values, So I am just wondering, has anyone run into this kind of problem before? any suggestions?

please let me know.

Many thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
lenght != length
 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
lenght != length




you mean I should do
frm.amount.value.lenght ! = length instead of
frm.amount.value.lenght==0 ?


Also, I have tried the above with other text field and they seem to be okay,

so i am really puzzled..

if some GURU outthere is willing to help, i'd really appreciate that..
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You spelled the word wrong, that is what Bear was saying!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, sorry to be obtuse. But don't you think it'd be a good idea to check your spelling before posting a problem?
 
reply
    Bookmark Topic Watch Topic
  • New Topic