Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function(){
- function toggleDiv(divId) {
- $("#" + divId).toggle();
- }
- function doLogin() {
- document.sendin.username.value = document.login.username.value;
- document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
- document.sendin.submit();
- return false;
- }
- function doCadastro() {
- $.ajax({
- type: "POST",
- cache: false,
- dataType: "json",
- data: {
- name: $('#name').val(),
- cpf: $('#cpf').val(),
- username: $('#username').val(),
- password: $('#password').val(),
- foreign: $('#foreign').val()
- },
- url: 'http://187.17.150.45/contratar/hotel-cicb.json',
- error: function (xhr, status, error) {
- $('#formBox1').prepend(xhr.responseJSON['errors'].join('<br>'));
- },
- success: function (data) {
- toggleDiv('formBox3');
- toggleDiv('formBox1');
- $('#formBox3').prepend('<div style="color: #EEEB16; font-size: 18px">Usuário cadastrado com sucesso!</div>');
- }
- });
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement