This topic is locked

Field Labels set in Javascript

4/30/2024 10:15:28 AM
PHPRunner General questions
D
druck281 author

Can field labels be set in Javascript? I have a page where the labels are stored in the DB and are dependent on one of the Category field on the page. When the user changes the value of the category field, I want to update the label. I know I can put it in the Field Event for the Category field to trigger the change but I cannot seem to get code to actually make the change.

I tried a couple variants that I saw in other posts but nothing is resulting in a change.

I tried modifiying the code from https://asprunner.com/forums/topic/29351-Dynamic-Section-Title--with-field-value

var ctrlMake = Runner.getControl(pageid,"Make");
ctrlMake.headerElement().find('a').html('Test');

and I tried

$("tr[data-fieldname='Make']").text("Testing");

Option B is just using the Labels API and reloading the page but that is kind of a pain when the user is in the process of Editing a record and they have to reload the page in order to update those field labels.

Thanks!