Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="cmd_form" method="post">
- <div>
- <input type="radio" id="rec_video" name="Command" /><label for="rec_video">Включить запись видео</label><br />
- <input type="radio" id="rec_sound" name="Command" /><label for="rec_sound">Включить запись звука</label><br />
- <input type="radio" id="logs_upload" name="Command" /><label for="logs_upload">Загрузить логи SMS и Звонков</label><br />
- <button type="button" id="sub" value="sub">Подтвердить действие</button>
- <input type="submit" id="submit_form" value="Отправить" />
- </div>
- </form>
- <script>
- var devIpAddr;
- var devCmd;
- var sample = {};
- sample.postData = function () {
- };
- $('#sub').click(function (e) {
- e.preventDefault();
- var cmd = "";
- if (document.getElementById('rec_video').checked) {
- cmd = "cmd_rec_video";
- $.ajax({
- type: "POST",
- url: "@Url.Action("PostCommand")",
- data: "command = [{cmd :" + cmd + "}]",
- success: function (data) { alert('data: ' + data); },
- complete: function () { alert('finished'); alert(); }
- });
- }
- if (document.getElementById('rec_sound').checked) {
- cmd = "cmd_rec_sound";
- $.ajax({
- type: "POST",
- url: "@Url.Action("PostCommand")",
- data: "command = [{cmd :" + cmd + "}]",
- success: function (data) { alert('data: ' + data); },
- complete: function () { alert('finished'); alert(); }
- });
- }
- if (document.getElementById('logs_upload').checked) {
- cmd = "cmd_logs_upload";
- $.ajax({
- type: "POST",
- url: "@Url.Action("PostCommand")",
- data : "command = [{cmd :"+ cmd+"}]",
- success: function (data) { alert('data: ' + data); },
- complete: function () { alert('finished'); alert(); }
- });
- }
- if (cmd == "") alert("Не выбрана команда");
- //devCmd = cmd;
- //sample.postData(devCmd);
- alert('sample=' + sample);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement