Advertisement
Guest User

Hotspot

a guest
Oct 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. function toggleDiv(divId) {
  4. $("#" + divId).toggle();
  5. }
  6.  
  7. function doLogin() {
  8. document.sendin.username.value = document.login.username.value;
  9. document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
  10. document.sendin.submit();
  11. return false;
  12. }
  13.  
  14. function doCadastro() {
  15. $.ajax({
  16. type: "POST",
  17. cache: false,
  18. dataType: "json",
  19. data: {
  20. name: $('#name').val(),
  21. cpf: $('#cpf').val(),
  22. username: $('#username').val(),
  23. password: $('#password').val(),
  24. foreign: $('#foreign').val()
  25. },
  26. url: 'http://187.17.150.45/contratar/hotel-cicb.json',
  27. error: function (xhr, status, error) {
  28. $('#formBox1').prepend(xhr.responseJSON['errors'].join('<br>'));
  29. },
  30. success: function (data) {
  31. toggleDiv('formBox3');
  32. toggleDiv('formBox1');
  33. $('#formBox3').prepend('<div style="color: #EEEB16; font-size: 18px">Usuário cadastrado com sucesso!</div>');
  34. }
  35. });
  36. }
  37. }
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement