深入浅出SharePoint——定制保存Item按钮

 

<script type="text/javascript" src="/_layouts/style/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('[id*="toolBarTbltop"]').closest('table').hide();
$('[id*="toolBarTbl"]').closest('table').hide();
$('[id="OK"]').bind('click',function(){
  alert($('input[title="Title"]').val());
if($('input[title="Title"]').val()=="a")
{
  return false;
}
else
{
   $('[id*="SaveItem"]:first').click();
}
});

$('[id="testCancel"]').bind('click',function(){
  $('[id*="GoBack"]:first').click();
});
});
</script>
<input name="testOK" class="ms-ButtonHeightWidth" id="testOK" accessKey="O" type="button" target="_self" value="OK"/>
<input name="testCancel" class="ms-ButtonHeightWidth" id="testCancel" accessKey="O" type="button" target="_self" value="Cancel"/>

 

posted @ 2013-07-17 17:16  风影极光  阅读(285)  评论(0编辑  收藏  举报