diff options
Diffstat (limited to 'modules-available/roomplanner/js')
-rw-r--r-- | modules-available/roomplanner/js/init.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules-available/roomplanner/js/init.js b/modules-available/roomplanner/js/init.js index 67090cc2..83f94390 100644 --- a/modules-available/roomplanner/js/init.js +++ b/modules-available/roomplanner/js/init.js @@ -21,13 +21,18 @@ function initRoomplanner() { }); $("#saveBtn").click(function() { + var managerip = $('#manager-ip').val().trim(); + if (managerip.length !== 0 && !(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(managerip))) { + alert('Invalid IP address format'); + return; + } $('#saveBtn').prop('disabled', true); $('#error-msg').hide(); $('#success-msg').hide(); $('#saving-msg').show(); var serializedCurrent = roomplanner.serialize(); $.post('?do=roomplanner&locationid=' + locationId, - { token: TOKEN, action: 'save', serializedRoom: serializedCurrent } + { token: TOKEN, action: 'save', serializedRoom: serializedCurrent, managerip: managerip } ).done(function ( data ) { if (data.indexOf('SUCCESS') !== -1) { window.close(); |