 
 
 				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;
 
 



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

					console.log($(this));
					console.log(e);
					console.log('next=val');

					console.log($(this).val());

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



						console.log('bareID:' + bareID);
						var matchRole='permit_agent_role_' + bareID;
						console.log('matchRole: ' + matchRole);
						var theRole=$("#" + matchRole).val();
							console.log('theRole:' + theRole);
						if (theRole=='issued to'){
							hasIssuedTo=true;
						} elseif (theTOle=='issued by') {
							hasIssuedBy=true;
						}
					}

				});
