 
 
 				if (hasPermitType==false){
-					alert('Provide at least one permit type.');
+					theProb.push('Provide at least one permit type.');
+				}
+				if (hasIssuedTo==false){
+					theProb.push('Provide at least one agent in role `issued to`.');
+				}
+				if (hasIssuedBy==false){
+					theProb.push('Provide at least one agent in role `issued by`.');
+				}
+
+
+				if (theProb.lenght > 0){
+					alert(theProb.join("\n"));
 					return false;
 				}
 
-				 alert('Text-field is empty.');
+				alert('Text-field is empty.');
 	        	return false;
 
 

						console.log('bareID:' + bareID);
						var matchRole='permit_agent_role_' + bareID;
						console.log('matchRole: ' + matchRole);
					}

				});



				$("input[id^='permit_agent_id_']").each(function(e){


					console.log('val: ' + $(this).val());
					console.log('id:' + this.id);


