if value is set from outside mark as not required
This commit is contained in:
parent
0f7bbacce3
commit
650cc75df0
|
@ -402,7 +402,7 @@ class CCPFileInputWidgetController extends CCPBaseInputWidgetController{
|
|||
if(this.value.length <= 1){
|
||||
const v = this.value.length ? this.value[0] : ''
|
||||
return `
|
||||
<input type="file" data-index="0" class="my-2 form-control" placeholder="${this.title}" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${this.required ? 'required' : ''} value="${v}"/>
|
||||
<input type="file" data-index="0" class="my-2 form-control" placeholder="${this.title}" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${this.required && !v ? 'required' : ''} value="${v}"/>
|
||||
<small name ="preview" class="form-text text-muted">${v.substr(0,5) + "..." + v.substr(v.length-5)}</small>
|
||||
`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue