Skip to main content

Jorge (El Che) Vasquez Blog

Go Search
Metrostar Systems Blog
  
Metrostar Systems Blog > Jorge (El Che) Vasquez Blog > FAQ > FAQ2  

A Developer's Diary
ISSUE:
I am customizing the EditForm.aspx file and have added an HTML Table Tag. Moreover, when I set the "ID" attribute for the HTML TABLE Tag and save the page, SharePoint keeps on appending the following {generate-id()} . How can I get rid of this, since I am not able to call HTML by ID due to this stuff that SharePoint appends.
 
SOLUTION:
SharePoint appends the following: {generate-id()} onto HTML element within the body of the form, whose "ID" attribute has been set.  Moreover when the HTML element is rendered onto the page, its ID attribute would contain a 6 character string appended.

<input type="text" id="tbLuckyNumberID0EAAA" value="23">
  1. You must create a dummy parameter
  2. Append the dummy parameter to the ID attribute

EXAMPLE:

  1. In the below example, I have set the ID attribute on an HTML TD Tag and an HTML INPUT Tag

    Before Saving File
  2. Once you save the file, you will notice that SharePoint appends its evil code

    After Saving File
  3. Hence, you must create a dummy paramter

    Createa a Dummy Paramater
  4. And finally, you must append to the ID attribute you own evil code


    Adjust Code
  5. Moreover when the HTML element is rendered onto the page, its ID attribute has rendered as per your own code.

    <input type="text" id="tbLuckyNumber" value="23">

  6. Let me know if it helps. ;)