Commit f35fc12b authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent e929e5cd
......@@ -225,14 +225,6 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
// handle inputfile
$("a[class^=inputfile_]").click(function(){
$("#"+$(this).attr("class")).html($(this).html());
var parts = $(this).attr("class").split("_"),
parameter = parts.slice(1, parts.length).join("_");
if ($(this).html() == "url") {
rules[parameter].remote.data.type = "urlfile";
} else if ($(this).html() == "server file") {
rules[parameter].remote.data.type = "localfile";
}
//$("#workflow_form").validate({ rules: rules });
});
$('.date').datepicker().on('changeDate', function(ev){ $('.date').datepicker('hide');} );
......@@ -273,6 +265,20 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
crule["number"] = true;
} else if (param.type == "date") {
crule["date"] = true;
} else if (param.type == "inputfile") {
crule["remote"] = {
url: server_url + '/validate_field?callback=?',
type: "post",
data: {
type: function() {
if ($("#inputfile_"+param.name).html() == "url") {
return "urlfile"
} else if ($("#inputfile_"+param.name).html() == "server file") {
return "localfile"
}
}
}
};
// if it is not a known type, check from the custom ones, using the validate_field address
} else {
crule["remote"] = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment