質問

I have a small request from my manager.He wants a custom complete button which checks if the fields are empty and if not provides an error and if not then the item gets saved in the list. I know there is a save button already but he does not want the fields to be required through share point column property. I want to implement the above solution but there is a problem : i do not have the admin access of the site so the best i can do is to add a button through content editor and write the validations but i still do not know how to go about it.

If there is anything you guys can help me out with, it would be appreciated.

Thanks

役に立ちましたか?

解決

You can PreSaveAction() function to validate the field(s) before saving the item,

in the new item form, click edit page then add content editor web part and add your PreSaveAction(), it will execute when user clicks Save button & before the item is saved, below is a sample:

<script type="text/javascript">
function PreSaveAction() 
{

        if ($("input[title='field name']").val()=="")
            {
               alert('Please, fill the field etc ..."');
              return false;
            }

        else
              return true
}
 </script>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top