Hi, I am using the Phatfusion validation to validate my form. I am trying to get a field to be require field only if a certain drop down selection is selected. I also want this field (number only) to validate be at less value of 25. I have the below script but it will not work. Please Help. Thanks.
getList: function(){
var list = new Element('ul');
this.list.each(function(el,i){
if(el.title != ''){
var li = new Element('li').injectInside(list);
new Element('label').setProperty('for', el.id).setText(el.title).injectInside(li);
}
});
return list;
},
validate: function(el){
var valid = true;
this.clearMsg(el);
switch(el.type){
case 'text':
case 'textarea':
case 'select-one':
if(el.value != ''){
if(el.hasClass('email')){
var regEmail = /^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;
if(el.value.toUpperCase().match(regEmail)){
valid = true;
}else{
valid = false;
this.setMsg(el, '');
}
}