Continuing the Product Detail page Validation process
I now need to validate the embroidery selection process before the Add to Cart is submitted
I have it working when the Add Embroidery option is selected from the dynamic select menu or embroidery is not offered for the product.
I am stumbling on when embroidery is offered and the No Embroidery option is selected.
Currently the validation process is being activated for those fields
I have the following for when embroidery is not even offered for a product
if ($totalRows_rsEmbroidery > 0) {
$WAFV_Errors .= WAValidateRQ(((isset($_POST["eCart1_1_Embroidery_Add"]))?$_POST["eCart1_1_Embroidery_Add"]:"") . "",true,2);
}
however this is not working for the embroidery selection process fields
if ($totalRows_rsEmbroidery > 0) {
$WAFV_Errors .= WAValidateRQ(((isset($_POST["eCart1_1_EmbroideryType_Add"]))?$_POST["eCart1_1_EmbroideryType_Add"]:"") . "",true,3);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["eCart1_1_embroiderystyle_Add"]))?$_POST["eCart1_1_embroiderystyle_Add"]:"") . "",true,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["EmbroideryText"]))?$_POST["EmbroideryText"]:"") . "",true,5);
}
I understand it is not the correct 'if' statement.
What I need to be asking is 'if' the customer selects the second option on the dynamic select menu then continue with the validation process
something similar to
if(optionIndex == '2') {
$WAFV_Errors .= WAValidateRQ .....
}
but needs to be specific to the <select name="eCart1_1_Embroidery_Add"> menu
I have attached the product_detail file
thanks