Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Client-side Validation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
enkodellc committed Jun 6, 2014
1 parent 8524d5f commit b468d68
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions public/modules/articles/views/create-article.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@
<h1>New Article</h1>
</div>
<div class="col-md-12">
<form name="articleForm" class="form-horizontal" data-ng-submit="articleForm.$valid && create()" novalidate>
<form name="articleForm" class="form-horizontal" data-ng-submit="create(articleForm.$valid)" novalidate>
<fieldset>
<div class="form-group">
<div class="form-group" ng-class="{ 'has-error' : submitted && articleForm.title.$invalid}">
<label class="control-label" for="title">Title</label>
<div class="controls">
<input type="text" data-ng-model="title" id="title" class="form-control" placeholder="Title" required>
<input name="title" type="text" data-ng-model="title" id="title" class="form-control" placeholder="Title" required>
</div>
</div>
<div class="form-group">
<div ng-show="submitted && articleForm.title.$invalid" class="help-block">
<p ng-show="articleForm.title.$error.required" class="text-danger">Title is required</p>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error' : submitted && articleForm.content.$invalid}">
<label class="control-label" for="content">Content</label>
<div class="controls">
<textarea data-ng-model="content" id="content" class="form-control" cols="30" rows="10" placeholder="Content"></textarea>
<textarea name="content" data-ng-model="content" id="content" class="form-control" cols="30" rows="10" placeholder="Content" required></textarea>
</div>
<div ng-show="submitted && articleForm.title.$invalid" class="help-block">
<p ng-show="articleForm.content.$error.required" class="text-danger">Content is required</p>
</div>
</div>
<div class="form-group">
<input type="submit" class="btn btn-default">
Expand Down

0 comments on commit b468d68

Please sign in to comment.