I am (very) new to Sharepoint and am a little stuck.
I have created a list containing a number of dropdown columns which are all required fields.
Sharepoint defaults the list to the first item on each dropdown which is not great.
So I have added an entry of to each dropdown list to appear first.
The problem is I need to find a way to prevent people from selecting that value.
I looked around a lot online but couldn't get anything to work.
The code below looks like it should work just fine, but for some reason is not doing anything!
Would anybody be able to offer some advice?
<script src="../../SiteAssets/jquery.min.js"></script>
<script>
function PreSaveAction()
{
return formVal(); //calls the validation on save
}
function formVal() {
if ($("[title='Name']").val() == '<Select From List>') {
alert('Error: Please select a name before submitting');
return true;
}
else {
return false;
}
</script>