Form demo
How do I make an form demo?
What is a form demo? How do you make a form demo? This script and codes were developed by Edward R Haase on 13 January 2023, Friday.
Form demo - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Form demo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
</head>
<body>
<div class="container" ng-app="app" ng-cloak="ng-cloak" ng-controller="ctrl" hotkey="{del: clearForm}"> <center> <h3><b>METHOD TO DETERMINE ADDRESS OF NEW STRUCTURES</b></h3> </center> <table class="table table-striped col-md-4"> <tr> <td>1</td> <td>Numbering increment chosen by town (e.g. 5.28", 25', 50', 100')</td> <td> <input type="number" ng-model="ln1" ng-init="ln1=0"/> </td> </tr> <tr> <td>2</td> <td>Existing address of closest structure on same road</td> <td> <input type="number" ng-model="ln2" ng-init="ln2=0"/> </td> </tr> <tr> <td>3</td> <td>Distance from this structure to new one</td> <td> <input type="number" ng-model="ln3" ng-init="ln3=0"/> </td> </tr> <tr> <td>4</td> <td>Is existing structure on same side of road?</td> <td ng-init="ln4=true"> <input type="radio" name="ln4" ng-value="true" ng-model="ln4"/> <label>Yes</label> <input type="radio" name="ln4" ng-value="false" ng-model="ln4"/> <label>No</label> </td> </tr> <tr ng-init="ln5=true"> <td>5</td> <td>Does the existing structure come before the new strucutre on the road?</td> <td> <input type="radio" name="ln5" ng-value="true" ng-model="ln5"/> <label>Yes</label> <input type="radio" name="ln5" ng-value="false" ng-model="ln5"/> <label>No</label> </td> </tr> </table> <center> <h4><span style="color: green"><b>TO DETERMINE THE NEW ADDRESS:</b></span></h4> </center> <table class="table table-striped col-md-4"> <tr> <td>6</td> <td>Divide line 3 by line 1 (rounding)</td> <td> <label>{{ln6()}} ({{ln3/ln1 | number:2}})</label> </td> </tr> <tr> <td>7</td> <td>Is the number on line 6 an even number?</td> <td>{{ln7()}}</td> </tr> <tr> <td>8</td> <td>If lines 4 & 7 are both yes or both no, 0, otherwise 1</td> <td>{{ln8()}}</td> </tr> <tr> <td>9</td> <td>Add lines 6 & 8</td> <td>{{ln9()}}</td> </tr> <tr> <td>10</td> <td>New address</td> <td>{{ln10()}}</td> </tr> </table> <button class="btn btn-default" type="button" ng-click="clearForm()">Reset</button> <label>(You can also use the 'delete' key to reset the form)</label>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/angular-hotkeys/1.6.0/hotkeys.js'></script> <script src="js/index.js"></script>
</body>
</html>
Form demo - Script Codes JS Codes
var app = angular.module('app', ['cfp.hotkeys']);
app.controller('ctrl', ['$scope', function($scope) { angular.extend($scope, { clearForm: function() { $scope.ln1 = 0; $scope.ln2 = 0; $scope.ln3 = 0; $scope.ln4 = true; $scope.ln5 = true; }, ln7: function() { return ($scope.ln6() % 2) === 0; }, ln8: function() { return ($scope.ln4 == $scope.ln7())?0:1; }, ln9: function() { return $scope.ln6() + $scope.ln8(); }, ln10: function() { if($scope.ln5 === true) return $scope.ln9() + $scope.ln2; else return $scope.ln2 - $scope.ln9(); } }); $scope.clearForm(); $scope.isLn6Even = function() { return ($scope.ln6() % 2) === 0; } $scope.ln6 = function() { return Math.round($scope.ln3/$scope.ln1); }
}]);
Developer | Edward R Haase |
Username | ehaase |
Uploaded | January 13, 2023 |
Rating | 3 |
Size | 3,379 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
CSS only button confirm | 1,840 Kb |
OMDB Async Typeahead search with Angular | 2,360 Kb |
Formatting Trakt.tv summary with Angular | 4,300 Kb |
Ui.bootstrap alert controller demo | 2,440 Kb |
AngularJS Inline template with ng-repeat | 1,860 Kb |
Simple angular smart table demo | 2,096 Kb |
Scope change trace | 1,776 Kb |
Angular google maps | 2,547 Kb |
Sortable panels with Angular | 2,840 Kb |
Maintain calculated relationship between input fields with AngularJS | 2,393 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Two column of responsive height | Fixie | 2,908 Kb |
Wikipedia viewer | Chpecson | 2,865 Kb |
Promodoro | Bencarp | 1,712 Kb |
Lazy Load for Background Images | The_ruther4d | 2,977 Kb |
FontAwesome icons with animation | Nicotinell | 2,083 Kb |
Beveled corners using CSS border attribute | DawsonMediaD | 2,136 Kb |
Content Changer | Cliffpyles | 4,538 Kb |
Comparison of Roboto Draft vs Roboto | Jxnblk | 2,880 Kb |
AOR site logo | Thatbram | 2,527 Kb |
Slide out Menu | Rbiggs | 4,936 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!