Developer forum

Forum » Ecommerce - Standard features » Checkout validation - fires when going back

Checkout validation - fires when going back

Martin Nielsen
Reply
Hi DW,

When using field validation on a cart, you can set up different rule you want to enforce, and that's pretty awesome :-)
But the validation seems to be enforced even if you go back in your flow.

I have this flow in my shop:

Cart -> Customer information -> Payment -> Confirm -> Reciept

And I have created a validation rule for Customer Email and Customer Name

When i go from "Customer information -> Payment" (forward) my validation fires which is intended.
But when i go from "Customer information -> Cart" (back) the validation also fires, which isn't what i want.

The validation forces people to supply customer info before they can go back from a step,
But when a customer goes back in the cart, it propably means that they don't want to fill in the details at this point, and therefore we should not force them.

Can i do something to make validation work, only when going forward?

Regards
 Martin, Co3



Replies

 
Morten Bengtson
Reply
The validation is triggered whenever you make a postback with order fields. To avoid this, you can place your back button in a separate form...

<form method="post" action="">
<input type="submit" name="<!--@CartV2.PreviousStepButtonName-->" value="Previous" />
</form>
/Morten
 
Martin Nielsen
Reply
Hmmm.. Guess i should have thought of that.

It just didn't (and still doesn't) feel like the "right" way.
I can't think of a scenario where you would need to validate when going back, so i'd argue that DW should just ignore validation when 
<input type="submit" name="<!--@CartV2.PreviousStepButtonName-->" value="Previous" />
is posted.

But i'll add the extra form for now, but it feels like a workaround :-)

 

You must be logged in to post in the forum