@(selected: List[String])
@main("Test Scripts Page") { <div class="page-header page-heading"> <h1 class="pull-left">Test Scripts Page</h1> @helper.form(action = helper.CSRF(routes.MyController.create(selected))) { <input type="submit" class="btn btn-primary pull-right" value="Done >"> } <div class="clearfix"></div> <p class="lead text-left">Choose Buttons</p> </div> @for(index <- 0 to 3) { <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary"><input type="checkbox" name="options" id="option-@index" aria-pressed="false" autocomplete="off" checked>option @index</label> </div> <!-- buttons --> }
<input type="text" id="buttonvalue"/> <script> $(window).unload(function() { var jsArray = [] $('.btn-group checkbox:selected').each(function() { jsArray.push($(this).attr("id")); }); selected = Json.fromJson(jsArray, String); $("#buttonvalue").val(selected.text()); }); </script>}--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/71b545d4-6d99-4755-bede-9d91395e9a64%40googlegroups.com.
<div class="page-header page-heading"> <h1 class="pull-left">Test Scripts Page</h1> <input type="submit" id="submitButton" class="btn btn-primary pull-right" value="Done >"> <div class="clearfix"></div> <p class="lead text-left">Choose Buttons</p> </div> <div id="myButtons" class="btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> <input type="checkbox" name="options" id="option1" autocomplete="off" checked> Box 1 (preselected) </label> <label class="btn btn-primary"> <input type="checkbox" name="options" id="option2" autocomplete="off"> Box 2 </label> <label class="btn btn-primary"> <input type="checkbox" name="options" id="option3" autocomplete="off"> Box 3 </label> </div>
<script> $('#submitButton').click(function(e) { var selected = $( "#myButtons :checked" ).map(function() { return this.id; }).get().join(); var selections = JSON.stringify({ 'selected' : selected }); $.ajax({ type : "POST", dataType: 'json', data: selections, contentType: "application/json; charset=utf-8", url : "@routes.Application.getSelection()", success: function(data) { console.log(data); } }); return false; }); </script>public static Result getSelection() --
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/034be36f-5330-4c72-81f1-ed13b94ccf50%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/a1a5cf43-46d2-42a4-a00d-0ee6a26fa5b9%40googlegroups.com.