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

fix a bug with prefix files

parent a2a12fe8
......@@ -203,10 +203,13 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
$("[id^=urlfile_btn_]").each(function(){
var parts = $(this).attr("id").split("_"),
tid = parts.slice(2, parts.lenght).join("_");
$("#"+tid).prop('readonly', false);
// change the name of the val by the file name with the prefix
if ($("#"+tid).val()) {
$("#"+tid).val($this.uploadfiles[tid]+"_"+$("#"+tid).val());
// do this only if it is a browsefile ... if the field is on readonly
if ($("#"+tid).prop('readonly')) {
$("#"+tid).prop('readonly', false);
// change the name of the val by the file name with the prefix
if ($("#"+tid).val()) {
$("#"+tid).val($this.uploadfiles[tid]+"_"+$("#"+tid).val());
}
}
});
......
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