As per you comment to Nisarg's answer your best bet may be a simple piece of Javascript.
In a script web part or a file attached to a content editor web part:
(If you already have jquery on the form/or on site change the src call as needed. Current one below requires an outside internet connection to work)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
function PreSaveAction()
{
return formVal(); //calls the validation on save
}
function formVal() {
if ($("[title='NameOfChoiceField']").val() == 'Yes') {
return true;
}
else {
if ($("[title='NameOfTextBoxField']").val().length) //checks if not empty use length > X to stipulate min char length allowed
{
return true;
}
else { //textbox is empty
alert('Error: Please add a reason into the box before submitting');
}
}
return false;
}
</script>
Edited as per Danny's suggestion regarding PreSaveAction()
From here are edits made by user normsp
Update: I had to add more dropdowns and multiline textboxes but something is wrong with my "OR" syntax. And also, is it possible to add a separate error message for each multiline textboxes?
<script>
function formVal() {
var errorMessage = ''; //All error messages will be displayed in one alert box at end of check
//a '!' indicates not equal to
if ($("[title='Acknowledgement']").val() != 'Yes')
{
if ($("[title='Acknowledgement Exception']").val().length < 0)
{
errorMessage += 'Error Message1 \n';
}
//add other if's here to check for other conditions. Alternatively use a switch statement
}
if ($("[title='Preparation/Review']").val() != 'Yes') {
if ($("[title='Preparation/Review']").val().length < 0) {
errorMessage += 'Error Message2 \n';
}
}
/*
add other field checks here
*/
if (errorMessage)//checks if errorMessage is not empty
{
alert(errorMessage);
return false //Does not save.
}
return true;//if all validation passes return true to submit/save
}