Conditional Column Validations in SharePoint 2010 list using Javascript or SharePoint Designer 2010 -
in sharepoint list, have column called "column 1" "yes" , "no" dropdowns such selection of yes or no dropdown, related columns wil shown or hidden per set criteria.
if “column 1” dropdown "yes", columns related "column 1" should become mandatory filled , columns related dropdown "no" should not become mandatory.
if “column 1” dropdown "no", columns related both "yes" , "no" should become mandatory filled.
i want set validations above using javascript/sharepoint designer 2010 such that, when fields become mandatory (based on dropdown selections) not filled, , clicked on save button, system should give error message in red colour right below mandatory field telling fill field.
can please me code/method this? below screenshot of sample page trying on. if choose yes in "is cloud involved?" column, "choose cloud offers" column displayed , should become mandatory filled. if choose no in "is cloud involved?" column, "choose cloud offers" column hidden , should not become mandatory filled. if dont fill "choose cloud offers" , click save, should prompt error message way shows "is cloud involved?" field when nothing selected it. click here screenshot
on page write little jquery script before page loaded using following event:
$(document).ready(function(){ $("name of dropdown control").change(function(){ $("control #1 related column 1").prop('disabled', true); }); });
the above idea, need evaluate value of dropdown set .prop() enabled/disabled, have more consistent function performs value evaluation of dropdown , setting of .prop() in end, easiest straightforward way done fast.
remember, reading example based on jquery , need add jquery library loading of page when deploying solution.
the official jquery api has little functional sample:
Comments
Post a Comment