Developer forum

Forum » Ecommerce - Standard features » Validation Groups not working

Validation Groups not working

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

I have a Rapido (3.4) solution in both Dynamicweb 9.10.11 and 9.12.9, and in either I'm able to continue to the next step of the checkout without having selected a shipping method.

 

Is there anything else that I am missing?

 

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Nuno

Dynamicweb only validates fields that are submitted to avoid validation errors on steps where a field is not present.

Radio buttons and Checkboxes in html will not submit anything if nothing has been selected. In this case you have a radiobutton group where nothing has been selected and then the field is not submitted and hence not validated by Dynamicweb.

See "Data representation of a radio group" in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio

You have 2 ways of solving it - setting a default shipping provider in backend so one of them will always be selected, change the markup to set selected at at least one of them, or add a hidden field with the same name as the radio buttons. The latter will submit an empty field and trigger validation. If a shipping is selected both values are being submitted and then validation will pass.

BR Nicolai

Votes for this answer: 1
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

> Dynamicweb only validates fields that are submitted to avoid validation errors on steps where a field is not present.

That makes sense. Hadn't thought of that.

 

Thank you.

Nuno Aguiar

 

You must be logged in to post in the forum