If its within a form post (say Complete Order), then its simply a matter of using the 'required' attribute in that field. For example, <input type='checkbox' name="whatever" required> and HTML5 will take care of it. if its not a checkbox, and some validation is required, HTML5 has some rudimentary methods tied to the 'TYPE" such as 'telephone, email, number' (see reference for complete listing. So,
<input type="email" name="home_phone" required>
Will basically check for "@" and "."
Announcement
Collapse
No announcement yet.
Required Custom Customer Fields
Collapse
X
-
Old post that needs to be circled back to. Thanks Bruce - PhosphorMedia for the miscellaneous fee work around. Is there a required custom field "workaround" that can be shared? I'm reaching on the behalf of a few others in need too. Thanks!Originally posted by lesliekirk View PostTo have the ability to make a Custom Customer Field required with the check of a box similar to the radio button ability to make a Store Setting > Customer Fields Hidden, Required or Optional.
Leave a comment:
-
FYI Just did this on a site this morning:Originally posted by lesliekirk View Post
Yeah, but we are being pushed away from using third-party modules. Case in point, the two that were being used in the MMUI store are now not working in the CSSUI store. I do agree that jquery for the validation would be the way to go. It would be great to tie into and improve how Miva validates the Customer required fields.
Code:In basketcharges loop <mvt:if expr="l.settings:charges:descrip"> <mvt:assign name="g.dontUpcharge" value="'Yes'"/> </mvt:if> Then outside: <mvt:if expr="l.settings:customer_clicked_checkbox AND NOT g.dontUpcharge"> <mvt:assign name = "l.basketcharge:basket_id" value = "g.basket:basket_id" /> <mvt:assign name = "l.basketcharge:module_id" value = "'999'" /> <mvt:assign name = "l.basketcharge:type" value = "'MISCFEE'" /> <mvt:assign name = "l.basketcharge:descrip" value = "'Misc. Fee'"/> <mvt:assign name = "l.basketcharge:amount" value = "'5.00'" /> <mvt:assign name = "l.basketcharge:disp_amt" value = "'5.00'" /> <mvt:assign name = "l.basketcharge:tax_exempt" value = "'0'" /> <mvt:do file="g.Module_Library_DB" name="l.success" value="BasketCharge_Insert(l.basketCharge)" /> <mvt:elseif expr="NOT(l.settings:customer_clicked_checkbox AND g.dontUpcharge"> <mvt:assign name = "l.basketcharge:basket_id" value = "g.basket:basket_id" /> <mvt:assign name = "l.basketcharge:module_id" value = "'999'" /> <mvt:assign name = "l.basketcharge:type" value = "'MISCFEE'" /> <mvt:assign name = "l.basketcharge:descrip" value = "'Misc. Fee'"/> <mvt:assign name = "l.basketcharge:amount" value = "'0.00'" /> <mvt:assign name = "l.basketcharge:disp_amt" value = "'0.00'" /> <mvt:assign name = "l.basketcharge:tax_exempt" value = "'0'" /> <mvt:do file="g.Module_Library_DB" name="l.success" value="BasketCharge_Insert(l.basketCharge)" /> </mvt:if>
Leave a comment:
-
It would also be nice to be able to define exactly what can be entered into a custom field. If we could have regexp filters or something we can define for them.
or at least be able to say numbers, alphanumeric, yes/no, etc.
Leave a comment:
-
Yeah, but we are being pushed away from using third-party modules. Case in point, the two that were being used in the MMUI store are now not working in the CSSUI store. I do agree that jquery for the validation would be the way to go. It would be great to tie into and improve how Miva validates the Customer required fields.Originally posted by heatherwebdev View PostI've had success using jquery for custom field validations, and using tool kit's upcharge feature to add a fee to a custom field
Leave a comment:
-
I've had success using jquery for custom field validations, and using tool kit's upcharge feature to add a fee to a custom field
Leave a comment:
-
Required Custom Customer Fields
To have the ability to make a Custom Customer Field required with the check of a box similar to the radio button ability to make a Store Setting > Customer Fields Hidden, Required or Optional.
It would also be nice to have the ability to have a Custom Field that could collect a fee.Tags: None
Leave a comment: