cancel
Showing results for 
Search instead for 
Did you mean: 
mc68b09e
Nintex Newbie

how to set readonly attribute to controls on Nintex Forms

Jump to solution

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.

0 Kudos
Reply
10 Replies
Automation Master
Automation Master

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

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

0 Kudos
Reply
Automation Master
Automation Master

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

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

0 Kudos
Reply
mc68b09e
Nintex Newbie

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

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

0 Kudos
Reply
mc68b09e
Nintex Newbie

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

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

0 Kudos
Reply
Not applicable

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

Hi

You can try to set the disabled attribute to the textbox. Example as shown

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

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

0 Kudos
Reply
mc68b09e
Nintex Newbie

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

Hi Raj san

Thank you for your replay.

I tried below code and result are not worked.

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

thanks.

0 Kudos
Reply
Not applicable

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

HI,

  Are you getting the correct dom object. You need to debug to check if you are setting that attribute to the correct dom element. I tried on a  text box in my form. it works perfectly. I notice you are trying to select webCtrl = NWF$("#"+reqFields[index]); so debug and check if the webCtrl is the correct dom object.

0 Kudos
Reply
Automation Master
Automation Master

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

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

0 Kudos
Reply
mc68b09e
Nintex Newbie

Re: how to set readonly attribute to controls on Nintex Forms

Jump to solution

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.

0 Kudos
Reply