• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

help with validation/ 2 functions on submit.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok first off I'm a beginner and am flying blind so to speak. Google and looking at other coding is what got me this far. I need this to run the function CCnotes() on submit as well as validate the fields which i tried to do via the ValidateCC function. Oh yes i do also have spry validation in here. and seeing it does not work on submit with running the CCnotes() i am using it for an onblur "helper" so to speak.This is a credit card payment page. Any ideas and tips are appreciated. help!
 
Justin Greenwald
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh one small change. the submit button: onClick="return ValidateCC" has to be changed to onClick="return CCnotes" and then I don't know what to do with the validation. I am so lost. HELP!!
 
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just call ValidateCC() as the first statement in CCnotes() function and call


or try this may also work
dont call ValidateCC() as the first statement in CCnotes() function and modify your code as


just remeber to avoid return keyword ...for the above piece of code
am not sure about the result !!! just give a try ...
 
Justin Greenwald
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok so the second option didnt work. still working on the first one. how exactly would you call the ValidateCC() in CCnotes(). like i said im very new to this and want to make sure im getting stuff right. My only other thought with this is do i try to set up the validation to work down form. Like if statement (field 1 validate) pass then (field 2 validate) pass then....ect. and if fail dont submit or something like that. ideas?
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first thing when you are writing in any forums dont try write everything in single line it does make sense as well as
difficult to read also..!!! so take care from next time onwards when you are posting ...!!!
I have some questions to you
1) why you are posting everything to the same HTML page ???
2) why you are not doing a simple form validation in ValidateCC()
ok
below is a llink to simple js validation js simple validation
in that site you can find some more js functionalities .......
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic