I am facing an issue with a select tag that has 3 options: powerpoint, pdf, and spreadsheet. When uploading from Google Drive, there is no validation in place, so I can give a ppt link to the pdf option and it will still upload. Can someone help me with validating this?
Here is my code:
<div class="row widget-row" ng-if="mediaData.mediaType == 14">
<div class="form-group">
<label>Document Type*</label>
<select class="form-control" ng-model="mediaData.googleDocType" required>
<option value="0" >Powerpoint</option>
<option value="2" id="spreadsheet">Spreadsheet</option>
<option value="3">PDF</option>
</select>
</div>
</div>
<div class="row widget-row" ng-if="mediaData.mediaType == 14">
<div class="form-group">
<label>Link *</label>
<input type="text" class="form-control" ng-model="mediaData.docLink" required>
</div>
</div>
And here is the AngularJs code:
case '14' : $scope.googleDocumentObject = new GoogleDocumentObject();
if(mediaData.googleDocType == 0){
$scope.googleDocumentObject.source = mediaData.docLink;
$scope.googleDocumentObject.attributes.documentType = 0;
$scope.updateProgram("googlePPT",$scope.googleDocumentObject,1,$scope.cssObject);
}
else if(mediaData.googleDocType == 1){
$scope.googleDocumentObject.source = mediaData.docLink;
$scope.googleDocumentObject.attributes.documentType = 1;
$scope.updateProgram("googleDocument",$scope.googleDocumentObject,1,$scope.cssObject);
}
else{
$scope.googleDocumentObject.source = mediaData.docLink;
console.log($scope.googleDocumentObject.source);
$scope.googleDocumentObject.attributes.documentType = 2;
$scope.updateProgram("googleDocument",$scope.googleDocumentObject,1,$scope.cssObject);
}
break;