diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/projectPost.ejs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/views/projectPost.ejs b/views/projectPost.ejs index 5e7af87..80ed6d8 100644 --- a/views/projectPost.ejs +++ b/views/projectPost.ejs @@ -11,6 +11,7 @@ <form class="form-horizontal" method="post"> + <input type="hidden" name="project" value="<%= project._id %>"> <fieldset> <h1><legend><%= title %></legend></h1> @@ -35,10 +36,10 @@ </div> </div> <% - var d = new Date(); - var n = d.getFullYear() + '-' + ('0' + (d.getMonth()+1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2); - var t = d.toLocaleTimeString().slice(0, 5); - + // we need to populate the date- and timefield with the current time and date + var d = new Date(); + var n = d.getFullYear() + '-' + ('0' + (d.getMonth()+1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2); + var t = d.toLocaleTimeString().slice(0, 5); %> <!-- <%= d %> --> <div class="control-group"> @@ -51,15 +52,17 @@ <div class="control-group"> <label for="cost" class="control-label">Hvor mye <strong class="text-error">*</strong></label> <div class="controls"> - <input type="number" name="cost" id="cost" class="input-small" placeholder="0" required> + <input type="number" name="value" id="value" class="input-small" placeholder="0" required> </div> </div> <div class="control-group"> <label for="split_between" class="control-label">Delt på</label> <div class="controls"> - <select multiple="multiple"> - <option value="">Dennis</option> - <option value="">Kurt</option> + + <span class="selectAll">Select all</span> + <select name="participants[]" id="participants" multiple="multiple"> + <option value="5180e11b0074a8b029000001" selected="selected">Dennis</option> + <option value="51814b792c94cc5346000001" selected="selected">Kurt</option> </select> </div> </div> @@ -97,5 +100,12 @@ <% include footer %> + <script> + $(".selectAll").click(function() { + $('#participants').children().attr('selected','selected'); + //$(this).parent().find('option').attr('selected','selected'); + }); + </script> + </body> </html> |