I added the rtl but got this
('#adminForm').submit(); } jQ().ready(function() { jQ('#adminForm').validate({ submitHandler: function(form) { if (submitbutton() == true) { form.submit(); } } }); }); function submitbutton(mfrm) { var errorMSG = ''; var iserror=0; var form = document.adminForm; var srcList = eval( 'form.selected_cats' ); var srcLen = srcList.length; if (srcLen == 0) { errorMSG += "\u0642\u0633\u0645"+" : "+"\u0647\u0630\u0647 \u0627\u0644\u062e\u0627\u0646\u0629 \u0645\u0637\u0644\u0648\u0628\u0629"+'\n'; srcList.style.background = "#B94A48"; iserror=1; } else { for (var i=0; i < srcLen; i++) { srcList.options.selected = true; } } nbCurrentImages = document.getElementById('nbCurrentImages').value; if(max_total_file_count < nbCurrentImages) { if(max_total_file_count == 1){ errorMSG += "Veuillez selectionner l'option photos pour pouvoir mettre plus d'une image."+'\n'; } else { errorMSG += 'Vous avez trop de photos, le maximum autorisé est de '+max_total_file_count+'.'+'\n'; } iserror=1; } if(iserror==1) { return false; } else { //Little hack to be able to return the selected_cats srcList.name = "selected_cats[]"; return true; } } function updateFields() { var form = document.adminForm; var singlecat = 0; var length = 0; if ( typeof(document.adminForm.category ) != "undefined" ) { singlecat = 1; length = 1; } else if (typeof(document.adminForm.selected_cats ) != "undefined") { length = form.selected_cats.length; } else { length = 1; } } function checkdependency(child,parentname,parentvalue,cleanValue) { //Simple checkbox if (jQ('input[name="'+parentname+'"]').is(':checkbox')) { //alert("test"); if (jQ('input[name="'+parentname+'"]').attr('checked')) { jQ('#adminForm #'+child).show(); jQ('#adminForm #row_'+child).show(); } else { jQ('#adminForm #'+child).hide(); jQ('#adminForm #row_'+child).hide(); //cleanup child field if (jQ('#adminForm #'+child).is(':checkbox') || jQ('#adminForm #'+child).is(':radio')) { jQ('#adminForm #'+child).attr('checked', false); } else { if (cleanValue == true) { jQ('#adminForm #'+child).val(''); } } } } //If checkboxes or radio buttons, special treatment else if (jQ('input[name="'+parentname+'"]').is(':radio') || jQ('input[name="'+parentname+'[]"]').is(':checkbox')) { var find = false; var allVals = []; jQ("input:checked").each(function() { if (jQ(this).val() == parentvalue) { jQ('#adminForm #'+child).show(); jQ('#adminForm #row_'+child).show(); find = true; } }); if (find == false) { jQ('#adminForm #'+child).hide(); jQ('#adminForm #row_'+child).hide(); //cleanup child field if (jQ('#adminForm #'+child).is(':checkbox') || jQ('#adminForm #'+child).is(':radio')) { jQ('#adminForm #'+child).attr('checked', false); } else { if (cleanValue == true) { jQ('#adminForm #'+child).val(''); } } } } //simple text else if (jQ('#adminForm #'+parentname).val() == parentvalue) { jQ('#adminForm #'+child).show(); jQ('#adminForm #row_'+child).show(); } else { jQ('#adminForm #'+child).hide(); jQ('#adminForm #row_'+child).hide(); //cleanup child field if (jQ('#adminForm #'+child).is(':checkbox') || jQ('#adminForm #'+child).is(':radio')) { jQ('#adminForm #'+child).attr('checked', false); } else { if (cleanValue == true) { jQ('#adminForm #'+child).val(''); } } } } function dependency(child,parentname,parentvalue) { //if checkboxes jQ('input[name="'+parentname+'[]"]').change(function() { checkdependency(child,parentname,parentvalue,true); }); //if buttons radio jQ('input[name="'+parentname+'"]').change(function() { checkdependency(child,parentname,parentvalue,true); }); jQ('#'+parentname).click(function() { checkdependency(child,parentname,parentvalue,true); }); checkdependency(child,parentname,parentvalue,false); } jQ(document).ready(function() { updateFields(); });