By fcomijangos - Mon Jun 10, 2019 1:37 pm
- Mon Jun 10, 2019 1:37 pm
#824808
Hello,
I have a dynaform with a file object and a checkbox object. The file object should be disabled and so it's validation when the user checks the checkbox the file object is now enabled and its validation as well. All of this works visually, it turns from gray to white, but you can't actually upload anything. If you click the file upload object no window appears for you to select a file.
The file object is disabled and its validation enabled in its properties. If I enable it in the properties it works and I can upload documents, but the objects start enabled when it shouldn't. This also happens if I use getControl().prop('disable', true);
Is this a bug? is there any other way to do this
This is the code I'm using:
I have a dynaform with a file object and a checkbox object. The file object should be disabled and so it's validation when the user checks the checkbox the file object is now enabled and its validation as well. All of this works visually, it turns from gray to white, but you can't actually upload anything. If you click the file upload object no window appears for you to select a file.
The file object is disabled and its validation enabled in its properties. If I enable it in the properties it works and I can upload documents, but the objects start enabled when it shouldn't. This also happens if I use getControl().prop('disable', true);
Is this a bug? is there any other way to do this
This is the code I'm using:
Code: Select all
function enableFile()
{
var attachment = $("#attachment").getValue();
if(attachment == true)
{
$("#Gridfile").getControl().attr('disabled',false);
$("#Gridfile").enableValidation();
}
else if (attachment == false)
{
$("#Gridfile").getControl().attr('disabled',true);
$("#Gridfile").disableValidation();
$("#Gridfile").clear();
}
}
Last edited by fcomijangos on Wed Jun 12, 2019 5:05 pm, edited 1 time in total.