add type="button" on cancel buttons to avoid default validation of form
authorrougeronj
Fri, 03 Apr 2015 16:20:20 +0200
changeset 68 b209b49c99fb
parent 67 bc8fb175f4d9
child 69 88f76bf93465
add type="button" on cancel buttons to avoid default validation of form
client/app/auth/login_modal.html
client/app/auth/register_modal.html
client/app/books/add_modal.html
--- a/client/app/auth/login_modal.html	Fri Apr 03 16:19:19 2015 +0200
+++ b/client/app/auth/login_modal.html	Fri Apr 03 16:20:20 2015 +0200
@@ -10,7 +10,7 @@
 
 	<div class="modal-footer ng-scope">
 		<a href='' ng-click="register()">Creer un compte</a>
-		<button ng-click="cancel()" class="btn btn-warning">Cancel</button>
+		<button type="button" ng-click="cancel()" class="btn btn-warning">Cancel</button>
 		<button type="submit" ng-disabled="userForm.$invalid" class="btn btn-primary">Login</button>
 	</div>
 </form>
\ No newline at end of file
--- a/client/app/auth/register_modal.html	Fri Apr 03 16:19:19 2015 +0200
+++ b/client/app/auth/register_modal.html	Fri Apr 03 16:20:20 2015 +0200
@@ -11,7 +11,7 @@
 	</div>
 	
 	<div class="modal-footer ng-scope">
-		<button ng-click="back()" class="btn btn-warning">Retour</button>
+		<button type="button" ng-click="back()" class="btn btn-warning">Retour</button>
 		<button type="submit" class="btn btn-primary">Créer</button>
 	</div>
 </form>
\ No newline at end of file
--- a/client/app/books/add_modal.html	Fri Apr 03 16:19:19 2015 +0200
+++ b/client/app/books/add_modal.html	Fri Apr 03 16:20:20 2015 +0200
@@ -2,11 +2,13 @@
 	<h3 class="modal-title">Ajouter un nouveau Book</h3>
 </div>
 
-<div class="modal-body ng-scope">
-	<input type="text" class="form-control" ng-model='title' placeholder="Titre"></input>
-</div>
-
-<div class="modal-footer ng-scope">
-	<button ng-click="cancel()" class="btn btn-warning">Cancel</button>
-	<button ng-click="add()" class="btn btn-primary">OK</button>
-</div>
\ No newline at end of file
+<form ng-submit="add()" novalidate>
+	<div class="modal-body ng-scope">
+		<input type="text" class="form-control" ng-model='title' placeholder="Titre"></input>
+	</div>
+	
+	<div class="modal-footer ng-scope">
+		<button type="button" ng-click="cancel()" class="btn btn-warning">Cancel</button>
+		<button type="submit" class="btn btn-primary">Create</button>
+	</div>	
+</form>
\ No newline at end of file