Forum Discussion

StefanieKirs743's avatar
StefanieKirs743
Community Member
23 days ago

Text Entry-Three Fields

Hello community, I need help with this project I am working on. It requires a login page (attached) that contains a keypad. The goal is for the user to click the numbers on the keypad and fill in ea...
  • JesseWu's avatar
    JesseWu
    23 days ago

    I played around and found out: there is a curly bracket missing at the end of your numpad scripts. Any script error will disable all scripts from working. 

    var player = GetPlayer();
    var DCID_Ongoing = player.GetVar("DCID_Ongoing");
    var DCIDInput = player.GetVar("DCIDInput");
    var DriverID_Ongoing = player.GetVar("DriverID_Ongoing");
    var DriverIDInput = player.GetVar("DriverIDInput");
    var TractorNum_Ongoing = player.GetVar("TractorNum_Ongoing");
    var TractorNumInput = player.GetVar("TractorNumInput");

    if (DCID_Ongoing == true) {
        DCIDInput += "0";
        player.SetVar("DCIDInput", DCIDInput);
    } else if (DriverID_Ongoing == true) {
        DriverIDInput += "0";
        player.SetVar("DriverIDInput", DriverIDInput);
    } else if (TractorNum_Ongoing == true) {
        TractorNumInput += "0";
        player.SetVar("TractorNumInput", TractorNumInput);
    } //<-- This is the bracket you missed.

    For your testing, disable all other scripts. Fix one of them. If it works, copy to and enable others back on. Inspect the console on the preview panel helps you figure out what could be wrong :) 

    Once they are all set, you can add your original backspace and clear buttons back. I didn't try them because I am lazy. It just changes one line of code.