Skip to main content

Hi all

I am tring to set readonly attributes to control on Nintex Forms using below Javascript code.

example:

webCtrl = NWF$("#"+reqFields[index]);

No.1 webCtrl.css("readonly","readOnly");

No.2 webCtrl.css("readonly",true);

No.3 webCtrl.attr("readonly",true);

No.4 webCtrl.readonly=true;

I checked all of above, finally, all of them are failed to set readonly.

Does anybody know how to do this.

I want to set readonly for input, rechtext, checkbox, select and radio.

thanks.

Hi Shinsuke,

This is maybe a start

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

where txtDisabled is the Store Client ID in JavaScript variable for your field

Regards,

Christophe Raucq


Hello,

You could always use the built in rules editor to set the controls to "disabled" which works in many such cases.   This is much easier than setting the JS for each, but depending on your req you will know which method is best.

Thanks


Hi Raucq san

thank you for your replay,

I tried the 'Prop', but it ddi not worked.

I do not know why it does not worked.

thanks


Hi Mike M san

Thank you for your reply,

I know the rules help this function. Before i post this question, I tried the rule for set readonly, however the rule did not worked and i gave up to implement this fuction by rules.

It is my personal opinion, validations and rules on Nintex Forms are very delicate functions.

First time both of them work well, then re-publish the form without any change and they are not worked.

There are many case of above in my environment, so I want to know work-around way.

thanks


Hi Raj san

Thank you for your replay.

I tried below code and result are not worked.

webCtrl.attr("disabled","disabled");

thanks.


Hello,


Can you post an example of a Form Editor rule you are attempting to use that worked the first time, but not the second time?  It might have to do with the type of reference you are using within the rule.

Thanks,

Mike


HI Mike san

thank you for your reply. Before I post mine, please tet me confirm about below.

The readonly attr have any restrictions?

Once I checked, readonly acts text control only.

It it is yes, I have to do by rules.

thanks.


One thing to consider: Internet Explorer applies weird formatting to disabled controls, which cannot be changed. On one of the projects I intentionally replaced disabled attributes with readonly in a script because the form looked weird (especially because the disabled attribute was not applied consistently):


$fillerDiv.find('*[disabled]').not('[type="radio"],[type="checkbox"],[type="select"],select').attr('readonly', 'readonly').attr('disabled', null);

 


Reply