Jennifer
Scholar

Disabling field using JavaScript doesn't work

Jump to solution

Hi, 

 

I have a field that I want to disable using JavaScript (meaning that the user can't click on the checkbox)

 

bild.PNG

I tried using this

NWF$("#" + varIT).attr("disabled", true);

or this

NWF$("#" + varIT).prop("readonly", true);

but both didn't work.

 

What am I doing wrong?

 

 

0 Kudos
Reply
2 Replies
Tarf
Explorer

Re: Disabling field using JavaScript doesn't work

Jump to solution

Hi,

 

not a jquery pro so there might be a better solution, but this works for me:

NWF$("#" + varIT + " input[type=radio]").attr("disabled", "disabled")

I noticed the whole "Choice" control is rendered as an html table containing radio inputs, so I disabled them after noticing that disabling the table didn´t do the trick

View solution in original post

Reply
Jennifer
Scholar

Re: Disabling field using JavaScript doesn't work

Jump to solution

Hi Tarf 🙂

 

sorry for the late reply.

I just tried it out and it works!

 

Thanks once again for your help!

0 Kudos
Reply