Need JQuery to Add a (None) or blank value to SharePoint Lookup Column
-
08-02-2021 - |
Domanda
I have a Lookup column to another list but I need to display a "Blank" value or a "None" as the first item in the dropdown. The column must remain "Required". Does anyone have a JQuery example of how to do this?
Bismarck
Soluzione
Demo:
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"></script>
<script>
$(function () {
$("select[title='look']").prepend("<option selected>none</option>")
})
</script>
Tip:on-premise is different from online.The title of required look up column is "columnName Required Field" in SPO,you need to change it.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange