1

I have a list for events in which I have placed content editor web part in "NewForm.aspx", "EditForm.aspx" and "DispForm.aspx". to hide recurrence field using JavaScript

The field is hidden successfully using JavaScript but when I click on the event and click on View Event from ribbon the following error occurs:

The "ListFormWebPart" Web Part appears to be causing a problem

The JavaScript code in the above mentioned forms is as below:

<script type="text/javascript">
var TDs = document.getElementsByTagName("TD");
var i=0;
var tagContent = "";
while (i < TDs.length)
{
try
{
tagContent = TDs[i].innerText || TDs[i].textContent;
if (tagContent.indexOf("Recurrence") == 0 || tagContent.indexOf("Recurrence") == 3)
{
TDs[i+1].parentNode.removeChild(TDs[i+1]);
TDs[i].parentNode.removeChild(TDs[i]);
}
}
catch(err){}
i=i+1;
}
    </script>    

One more thing I would like to clear is, when I manually go to the list's form it redirects me to the page, i.e. when I type URL of display form the page is redirected successfully.

What am I missing?

  • Try to set display:none on the elements instead of removing them from the DOM – Robert Lindgren Mar 1 '14 at 9:10
-1

After searching the internet, I found an answer.

I had to increase the limit for resource throttling in Central Administration for my web application and after that it worked perfectly.

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.