Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Hiding Fields on NewForm and EditForm.aspx using Javscript
WhatsApp
Sagar Pardeshi
Oct 02
2014
1.4
k
0
0
<script language=
"javascript"
type=
"text/javascript"
>
_spBodyOnLoadFunctionNames.push(
"hideFields"
);
function
findacontrol(FieldName)
{
var
arr = document.getElementsByTagName(
"!"
);
// get all comments
for
(
var
i=0;i < arr.length; i++ )
{
// now match the field name
if
(arr[i].innerHTML.indexOf(FieldName) > 0)
{
return
arr[i];
}
}
}
function
hideFields()
{
var
control = findacontrol(
"Title"
);
control.parentNode.parentNode.style.display=
"none"
;
control = findacontrol(
"Document Link"
);
control.parentNode.parentNode.style.display=
"none"
;
control = findacontrol(
"PublishDate"
);
control.parentNode.parentNode.style.display=
"none"
;
}
</script>
Hiding fields on NewForm and EditForm.aspx
Up Next
Hiding Fields on NewForm and EditForm.aspx using Javscript