1

Is it possible in SharePoint (I use Classic Experience) to display a notification, when somebody choose particular value from choice field in New Form?

For example, I've a choice field in New Form, called "Country" - there is a list of values to choose USA, Europe, Asia.

If someone choose "Asia" then SharePoint display a pop-up or any notification windows about the content "Country is chosen".

Is it possible with a little coding in JavaScript?

2 Answers 2

1

If you are using Country choice field as a dropdown, try adding below code to your NewForm.aspx using Content Editor or Script Editor web part:

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
    
        //Show alert based on "Country" column 
        $("select[title^='Country']").change(function () {
            if ($(this).val() == "Asia") {
                alert("Asia is chosen");
            }
        });
    });
</script>
3
  • 1
    Hi Ganesh :) It's working, generally, i have to rebuild one script, because if I implement yours script, then other doesn't work.
    – analyzer64
    Commented May 26, 2021 at 13:08
  • If you have another script on same page, you can merge those as per your requirements. Commented May 26, 2021 at 13:13
  • 1
    Great, glad it worked for you. Please Upvote(^) and accept as an Answer as it helped you & it will help others with similar question in future to find the correct answer easily. Commented May 28, 2021 at 8:28
0

Ganesh, script which doesn't work after implement yours is based on SPServices.SPCascadeDropdowns.

Here's a section of it:

$(document).ready(function() { $().SPServices.SPCascadeDropdowns({ relationshipList: "Profity", relationshipListParentColumn: "Region", relationshipListChildColumn: "Title", parentColumn: "Zmiana Profitu", childColumn: "Country", debug: true }); })

childColumn, has values: USA, Europe and Asia, and there, if i choose "Asia", i'm expecting an alert "Asia is chosen". How to marry this two scripts?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.