$(document).ready(function() { if ( $("#reg_not_access").length ) { $('#input_form').hide(); }else{ $.getJSON("validation_rules.js.php?form_id=4f59819461d850b02c000000&lang=chi", function(json){ //rules = json; rules = extendValidation(json); applyFormValidate({ id: "application_form", rules: rules, url: "handler.php", target: "reg_output", beforeSubmit: onBeforePreviewHandle, success: onAfterSubmitHandle, errorContainer: "#errorMessageBox" }); }); $('#input_form').show(); } }); //success: function(response) {alert("abcd"); onAfterSubmitHandle(response);},