Solved

object oriented javascript web form

Posted on 2016-09-14
8
73 Views
Last Modified: 2016-09-15
Web form, OOP approach.

A basic checkout form, inputs: fullname, email, shipto, shiptozip, cardnumber, monthyear, cvc, a checkbox when clicked displays an alternate billto and billtozip option, and, of course, a submit button.

Professional client-side input validation coding is required.

My main objective is to see how OOP is used in javascript, and it must be usable for a typical live website and something that can be upsized for larger forms. I would like to see just pure javascript, so no libraries and frameworks, please.

Must provide a working example so I can see it work!
0
Comment
Question by:userTester
  • 5
  • 3
8 Comments
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 41798907
This isn't a question.  This is a job request.
0
 

Author Comment

by:userTester
ID: 41798914
zephyr_hex

So the question would be, how do you use JavaScript OOP in a real application? A web form is as basic as you can get.

It's not a job request!
0
 
LVL 42

Accepted Solution

by:
zephyr_hex earned 500 total points
ID: 41798928
So the question would be, how do you use JavaScript OOP in a real application?

That is not the question you asked.  You gave requirements for a job that is usually done on a hired basis.

If you're revising your question to the more generic "how is JavaScript OOP validation done in a real application?", here ya go: http://www.bymichaellancaster.com/blog/javascript-object-oriented-simple-form-validation/
0
 

Author Comment

by:userTester
ID: 41798950
Thanks, zephyr_hex, I will try the code out!

My apologies if my question wasn't clear enough, here's the part where I mention my intention:
My main objective is to see how OOP is used in javascript

The other part of my question is whether this approach would work for a real live website, or is there a lot more to it than what the article provides?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:userTester
ID: 41799033
zephyr_hex

I am not familiar with all the code in the example, so I am not sure how to use this object and unable to assess its validity. If you can help me see it working that would be ideal.

Thanks!
0
 

Author Comment

by:userTester
ID: 41799099
zephyr_hex

You'll be glad to know that I managed to figure it out and it looks spot on. I wish I could ask a few questions about the details of the example at  http://www.bymichaellancaster.com/blog/javascript-object-oriented-simple-form-validation?1
0
 
LVL 42

Expert Comment

by:zephyr_hex
ID: 41800048
What that article shows is how to validate user input on what is called "client side" -- that means before the input is sent to the server.  It's impossible to answer whether or not that validation is sufficient -- because it totally depends on what your requirements are.  The article is meant to show you how OOP validation is done, not give a comprehensive validation suite.  There are already tools built for that, such as this one and this one.

You will also need to consider server side validation, which is, in fact, far more important than client side validation (which can be circumvented).  Server side validation can not be circumvented and it's your last gateway to prevent invalid or malicious data into your database.

If you have specific questions about how the demo works, I encourage you to open an EE question and ask your specific question.  In many cases, it's helpful if you include a code snippet so we know what you're talking about.  Or, if the demo doesn't cover a topic you'd like to know more about, please open an EE question and ask.  So, for example, if it doesn't show how to validate a checkbox and you can't figure that part out, then open a question and ask how to validate a checkbox -- and include your current JavaScript and so we can see where the new logic would best fit in.
0
 

Author Closing Comment

by:userTester
ID: 41800276
Thanks zephyr_hex, that example does a lot for me. I will play around with the code and get to know it well. I am in touch with the author of that article and might shoot some questions his way as well. Thanks again!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now