To refer a SharePoint field from Jquery use the below syntax: -
var requestId = $("input[Title='Request ID']");
The above line searches for all the input controls whose Title attribute is equal to "Request ID". Note that "Request ID" is the field name.
The variable requestId now holds a reference to the field "Request ID". If you want to hide the particular control then write requestId.hide()
Note the above will only hide the particular control and not the entire row. To hide the entire row use requestId.parent().parent().parent().hide();
Below is the complete script.
<script src="/Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var requestId = $("input[Title='Request ID']");
requestId.parent().parent().parent().hide();
});
</script>
<script type="text/javascript">
$(document).ready(function(){
var requestId = $("input[Title='Request ID']");
requestId.parent().parent().parent().hide();
});
</script>
Enjoy!!!
*****************************************************************Free online C# tutorial. Learn easily, quickly and confidently.
Visit today www.tutorialnode.com
*****************************************************************
Looking for cheap Business Process Management Solutions for your Business?
Visit official website of Enterprise Connections http://entconn.co.uk
*****************************************************************
No comments:
Post a Comment