Commit 04de548274f524c31142254b905c51be2e545d04
1 parent
b528360b
Exists in
master
and in
1 other branch
fix bug submit null; insert alert js
Showing
2 changed files
with
12 additions
and
1 deletions
Show diff stats
src/web/static/css/style.css
src/web/templates/layout.html
| ... | ... | @@ -28,6 +28,16 @@ $ url_base = "http://localhost:8080" |
| 28 | 28 | window.onload = function() { |
| 29 | 29 | setupDependencies('weboptions'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' ) |
| 30 | 30 | }; |
| 31 | + | |
| 32 | +function validateForm() | |
| 33 | +{ | |
| 34 | +var x=document.forms["weboptions"]["pkgs_list"].value | |
| 35 | +if (x==null || x=="Write your list App here or send a file list this icon:") | |
| 36 | + { | |
| 37 | + alert("Write your list App!"); | |
| 38 | + return false; | |
| 39 | + } | |
| 40 | +} | |
| 31 | 41 | </script> |
| 32 | 42 | <script type="text/javascript"> |
| 33 | 43 | $$(document).ready(function() { |
| ... | ... | @@ -45,7 +55,7 @@ window.onload = function() { |
| 45 | 55 | <div id="header"> |
| 46 | 56 | <a href="$url_base" title="AppRecommender"><h1 id="logo"><span>AppRecommender</span></h1></a> |
| 47 | 57 | <div id="recommender-box"> |
| 48 | - <form action="apprec" enctype="multipart/form-data" method="post" name="weboptions"> | |
| 58 | + <form action="apprec" enctype="multipart/form-data" method="post" name="weboptions" onsubmit="return validateForm()"> | |
| 49 | 59 | <fieldset> |
| 50 | 60 | <div id="submit-box"> |
| 51 | 61 | <input type="submit" value="RECOMMENDER" id="submit-button"><br /> | ... | ... |