Commit 87a643ea authored by fv3rdugo's avatar fv3rdugo
Browse files

form checks

parent 2a05d668
......@@ -47,7 +47,7 @@ sub BUILD {
my $name = $_[0]->{name};
my $address = $_[0]->{address};
my $description = $_[0]->{description};
my $all_domains = $_[0]->{all_domains} ? 1 : 0;
my $all_domains = $_[0]->{all_domains} ? 1 : 0; #when checkbox is not checked is NULL, change to 0
my $no_domains = $_[0]->{no_domains} ? 1: 0;
$name = "" unless defined $name;
......
......@@ -16,7 +16,7 @@
<div class="pure-control-group">
<label>Name*</label>
<input name="name" id='name' type="text" placeholder="insert a network name" required >
<input name="name" id='name' ng-model="name" type="text" placeholder="insert a network name" required >
<div class="field-message" ng-messages="frm.name.$error" ng-if='frm.name.$dirty' ng-cloak>
<div ng-message="required">Network name is required</div>
</div>
......@@ -24,12 +24,9 @@
<div class="pure-control-group">
<label>Network*</label>
<!--<input name="network" ng-model="net.address" type="text" placeholder="i.e. 192.168.10.0/24" required ng-minlength="6" ng-maxlength="10"> -->
<input name="address" id='address' type="text" placeholder="i.e. 192.168.10.0/24" required >
<input name="address" id='address' ng-model="address" type="text" placeholder="i.e. 192.168.10.0/24" required >
<div class="field-message" ng-messages="frm.address.$error" ng-if='frm.address.$dirty' ng-cloak>
<div ng-message="required">Network address is required</div>
<div ng-message="minlength">TODO Network address must have minimum 6 characters</div>
<div ng-message="maxlength">TODO Password must have maximum 10 characters</div>
</div>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment