1. Hello Guest, selamat datang di Forum WinPoin. Kamu bisa bertanya, berdiskusi, sharing, dan ngobrolin apapun seputar Windows, Windows Phone, PC, Gadget, atau hal seputar Teknologi lainnya. Selamat berkomunitas! ;)

Ask help, coding javascript login :)

Discussion in 'Developer Corner' started by saputra pratama, Jul 9, 2015.

  1. saputra pratama

    saputra pratama New Member

    Joined:
    Jul 8, 2015
    Messages:
    13
    help, klo di menu login biar bisa langsung enter di javascript gmana ya?

    kira kira kurang dimana nya ya?
    function doLogin() {
    var username = $('#username').val();
    var password = $('#password').val();
    if ((username) && (password)) {
    loadAnim.animOpen(function () {
    var jpCredential = new jiipii.Credential;
    jpCredential.doLogin(username, password, function () {
    loadAnim.animClose();
    if (jpCredential.isAuth()) {
    setTimeout(goHome, 1000);
    } else {
    $.messager.alert('Login Failed!', "Invalid username or password.");
    }
    });
    });
    } else {
    $.messager.alert('Login Failed!', 'Username and password cannot be empty');
    }
    }




    :nanya::nanya::nanya::nanya:
     
  2. Yusril Ibnu

    Yusril Ibnu Winpoin Staff Staff Member

    Joined:
    May 12, 2014
    Messages:
    6,373
  3. Z.A.Y

    Z.A.Y Moderator Staff Member

    Joined:
    May 21, 2014
    Messages:
    1,796
    maksudnya enter saat berada di text inputnya?
    bikin event keypressed aja :v
     
  4. Z.A.Y

    Z.A.Y Moderator Staff Member

    Joined:
    May 21, 2014
    Messages:
    1,796
    kalau aku sih bikinnya gini _-_
    mungkin bisa membantu
    https://jsfiddle.net/0g5z6ju7/

    tambahkan ini
    $('.container .content input').keypress(function (event) {
    if (event.keyCode == 10 || event.keyCode == 13) {
    alert('Form tersebut harus ada tombol submit _-_ .');
    a
    }
    });
     
    • Like Like x 1
  5. saputra pratama

    saputra pratama New Member

    Joined:
    Jul 8, 2015
    Messages:
    13

    kaya di php ini brooh....
    iya iya baru inget ane ..

    event 13 kalo ga salah enter kan ya,,

    thanks bro Z.A.Y
     
  6. Z.A.Y

    Z.A.Y Moderator Staff Member

    Joined:
    May 21, 2014
    Messages:
    1,796
    8-) yo'i kalau udah threadnya ubah ke solved yah
     

Share This Page