• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Shopping cart - general validation issue

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Shopping cart - general validation issue

    Been creating a much simpler PHP replacement for my old jscript based shopping cart. It is possible using self post to do everything in PHP, even validate data and conditionally submit to https with only a few lines of code but was wondering if any validation is really necessary.

    Most sites do it but is there any point in having mandatory address fields like address 1 and postcode and showing popup if not filled in when you can't check that what they have put in is right anyway? An x in every box would work. May as well have a single address box and submit to Worldpay without validation. Worldpay itself only has a single billing address box so I can post directly without concatenating everthing, much simpler.

    Any opinions on that? Cheers.

    Only top left product finished but otherwise mostly working (for me anyway) here:

    Gaffys Shop
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    #2
    If the customer gets as far as payment before it fails, they're much more likely to abandon the order.

    A little bit of javascript would enable you to validate clientside without submitting the form.

    (You should always validate important stuff serverside too as clientside stuff can be hacked/turned off).

    I'm assuming you want to catch genuine mistakes/omissions rather than the customer entering 'x' in all the fields.

    Edit: Would also think that storing your address in sensible separate fields might prove useful later - e.g. your next payment provider might require a separate postcode, and trying to clean up free format address data is a painful task.
    Last edited by mudskipper; 9 November 2013, 14:21.

    Comment

    Working...
    X