javascript - Magento form validation of hidden values -
i have problem default magento form validation. i'm using accordion checkout page, when submit form, fields hidden. noticed hidden fields passing validation, if empty (required-entry class used). there way force validation script check fields, not visible ones?
thanks in advance.
i found answer here: http://awnist.com/blog/2011/05/02/overriding-magentos-form-error-mechanisms/
basically need overwrite isvisible method validated object return true it. load js code after loading /js/prototype/validation.js:
object.extend(validation, { isvisible : function(elm) { return true; }, insertadvice : function(elm, advice){ // advice contains div inserted. } });
overriding insertadvice optional - can use if want modify way how validation advice inserted.
Comments
Post a Comment