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

make rules working with readonly instead of disabled

parent b49b1792
......@@ -203,7 +203,7 @@ 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).removeAttr('disabled');
$("#"+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());
......@@ -295,10 +295,10 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
$("#"+tid).val("");
if ($(this).html() == "local file") {
$("#urlfile_btn_"+tid).show();
$("#"+tid).attr('disabled','disabled');
$("#"+tid).prop('readonly', true);
} else {
$("#urlfile_btn_"+tid).hide();
$("#"+tid).removeAttr('disabled');
$("#"+tid).prop('readonly', false);
}
});
$("[id^=urlfile_btn_]").click(function(){
......@@ -479,7 +479,7 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
// if param is a browsefile
'{{else param.type == "browsefile"}}',
' <div class="input-append">',
' <input id="${param.name}" name="${param.name}" class="${param.group} ${input_size}" type="text" value="${param.default}" disabled>',
' <input id="${param.name}" name="${param.name}" class="${param.group} ${input_size}" type="text" value="${param.default}" readonly="readonly">',
' <button id="urlfile_btn_${param.name}" class="btn" type="button"><i class="icon-search"></i></button>',
' </div>',
// if param is a boolean
......
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