+ Start a Discussion
SaintMichaelSaintMichael 

id for input fields

Is there any way to force apex:inputText to keep the id that I give it?

 

This:

<input id="tags" />

 becomes this:

<input id="j_id0:j_id2:j_id3:j_id4:tags" type="text" name="j_id0:j_id2:j_id3:j_id4:tags" />

 Any way to get the ids to stick?

My autocomplete is getting sabotaged by the id issue.

S91084S91084

It has basically assigned the page Id and the form Id to you input tag. When you reference the value in <script> you have to reference the tag as follows:

 

document.getElementById('{!$Component.<pageId>:<FormId>:<tagId>}').value