(js/html) Rename ID doesn't rename "label.for" neither "name"

I have the following html:

<label for="a_field">Label</label>
<textarea id="a_field" name="a_field"></textarea>

And the following JS code:

$('#a_field').show();

If I refactor->rename "a_field" to "b_field" from inside  the JS file, the html file changes to:

<label for="a_field">Label</label>
<textarea id="b_field" name="a_field"></textarea>

Neither the label "for" nor the textarea "name" are updated.

Is it on purpose?

greg

2 comments
Comment actions Permalink

Label reference is expected to be updated, and it is updated for me in a simple example. What IDE version are you using?
Name is not expected to be updated because changing it will make your code inconsistent with the server side part.

Regards,
Konstantin

0
Comment actions Permalink

I agree with you. However it could be nice to have "name" updated as an option: as more and more forms are handled by JS I assume less server-side code would be impacted.

I'm using PS-133.168; I'll try to create a separate sample to see if it works differently.

greg

0

Please sign in to leave a comment.