1

I have a Custom list form. To disable/populate few of the text box, I use a script editor webpart and hard-code the HTML ID of the text box.

Eg: $("#ctl00_**ctl40**_g_********_dd79_4268_b443_************_ff661_ctl00_ctl00_TextField").val("Yes");

Recently I have noted that the text box IDs are changed to

ctl00_**ctl41**_g_********_dd79_4268_b443_************_ff661_ctl00_ctl00_TextField"

Can someone point out what could be the reason and throw some light on how these HTML IDs are created?

1

Instead of accessing a field through a changeble ID, use the Dom Tree starting from a ID you've set in a a webpart surrounding div.

0

If you are using asp controls in custom list form,

Try to add ClientIDMode="Static" in textbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.