Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
2601843e
Commit
2601843e
authored
Nov 26, 2016
by
Ad Schellevis
Committed by
GitHub
Nov 26, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1278 from fabianfrz/validation_message
add validation message
parents
fc39bb33
fc1a15df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
vouchers.volt
...nsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt
+7
-0
No files found.
src/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt
View file @
2601843e
...
...
@@ -174,12 +174,18 @@ POSSIBILITY OF SUCH DAMAGE.
* link actual voucher generation in dialog
*/
$("#generateVoucherBtn").click(function(){
$('#generatevouchererror').html('');
$('#generatevouchererror').hide();
var voucher_provider = $('#voucher-providers').find("option:selected").val();
var voucher_validity = $("#voucher-validity").val();
var voucher_quantity = $("#voucher-quantity").val();
var voucher_groupname = $("#voucher-groupname").val();
if (!$.isNumeric(voucher_validity) || !$.isNumeric(voucher_quantity)) {
// don't try to generate vouchers then validity or quantity are invalid
var error = $('<p />');
error.text("{{ lang._('The validity and the quantity of vouchers must be integers.') }}");
$('#generatevouchererror').append(error);
$('#generatevouchererror').show();
return;
}
ajaxCall(url="/api/captiveportal/voucher/generateVouchers/" + voucher_provider + "/",
...
...
@@ -384,6 +390,7 @@ POSSIBILITY OF SUCH DAMAGE.
<h4 class="modal-title">{{ lang._('Generate vouchers') }}</h4>
</div>
<div class="modal-body">
<div id="generatevouchererror" class="alert alert-danger" role="alert" style="display: none"></div>
<table class="table table-striped table-condensed table-responsive">
<thead>
<tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment