From 03fc81d97d0988232a68d6a13e18740f937c7dc3 Mon Sep 17 00:00:00 2001 From: Miracle Agomishor Modey <miraclemodey@yahoo.com> Date: Wed, 18 Jul 2018 15:30:42 +0000 Subject: [PATCH] Add new file --- Assignment 1/index.html | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Assignment 1/index.html diff --git a/Assignment 1/index.html b/Assignment 1/index.html new file mode 100644 index 0000000..cb5adf0 --- /dev/null +++ b/Assignment 1/index.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> +<body> + +<h2>Company Type</h2> + +<p>Classification</p> + +<div ng-app="Classification" ng-controller="myCtrl"> + <form name="myForm"> + <select name="classifications" ng-model="selectedClassifications" ng-options="x.class for x in classifications"> + <option value="" disabled selected>-Select Classification-</option> + </select> +<p>Specific Type</p> + <select ng-model="selectedSpecificType" ng-options="y for y in selectedClassifications.type"> + <option value="" disabled selected>-Select Type-</option> + </select> + <br> +<h2>Proposed Names</h2> + +<p>Option 1</p> + <input type="text" name="option1" ng-model="option1" placeholder="Option 1" ng-pattern="selectedClassifications.regex" ng-disabled="!selectedClassifications || !selectedSpecificType"> + <span style="color:red" ng-show="myForm.option1.$error.pattern">enter a valid name</span> + <br> +<p>Option 2</p> + <input type="text" placeholder="Option 2"> + <br> + <input type="submit" ng-model="submit" ng-disabled="!selectedClassifications || !selectedSpecificType || !option1" value="Save and Continue"> + <br> + </form> +</div> + +<script> var app = angular.module('Classification', []); + app.controller('myCtrl', function($scope) {$scope.classifications = [ + {class : 'BUSINESS NAME', type: ["BUSINESS NAME"], regex : /^[\s\w]+[^(ltd|limited|plc)]$/}, + {class : 'COMPANY', type : ["PRIVATE COMPANY LIMITED BY SHARES", "PUBLIC COMPANY LIMITED BY SHARES", "PRIVATE COMPANY LIMITED BY GUARANTEE", "PUBLIC COMPANY LIMITED BY GUARANTEE", "PRIVATE UNLIMITED COMPANY", "PUBLIC UNLIMITED COMPANY"]}, + {class : 'INCORPORATED TRUSTEE', type : ["INCORPORATED TRUSTEE"], regex : /^[\s\w]+[^(ltd|limited|plc)]$/}]; + $scope.option1=''; + }); + +</script> + +</body> +</html> -- GitLab