{ for (var i=0; i < srcLen; i++) { srcList.options[i].selected = true; } } <?php } ?> if(iserror==1) { alert(errorMSG); } else { <?php if (function_exists("loadEditFormCheck")) { loadEditFormCheck("admin"); } ?> <?php if ($this->nbcats > 1) { ?> srcList.name = "selected_cats[]"; <?php } ?> submitform(pressbutton); } } function updateFields() {
submitHandler: function(form) { if (submitbutton() == true) { form.submit(); } } }); }); function submitbutton(mfrm) { var errorMSG = ''; var iserror=0; <?php if (PAIDSYSTEM){ loadEditFormCheck(); } ?> <?php if ($this->nbcats > 1) { ?> var form = document.adminForm; var srcList = eval( 'form.selected_cats' ); var srcLen = srcList.length; if (srcLen == 0) { errorMSG += <?php echo json_encode(JText::_('ADSMANAGER_FORM_CATEGORY')); ?>+" : "+<?php echo json_encode(JText::_('ADSMANAGER_REGWARN_ERROR')); ?>+'\n'; srcList.style.background = "#B94A48"; iserror=1; }