Reply To: Isaac Harned – Here for forms with javascript

  • Liz Larsen

    Member
    October 27, 2022 at 8:02 pm
    Points: 5,232
    Rank: UC2 Brainery Purple Belt UC2 Brainery Purple Belt Rank

    My last little tiny piece of advice would be to move the primary code from the dropdown boxes (ie the NumberOfTaps_ form field local code) into one single function within the global JavaScript. Then in each dropdown box local code, you would set a variable like var numberOfTaps = this.getField(“NumberOfTaps2”); then call the global function using that variable.

    This means if you need to update the primary code, you only have to update the global function rather than every single dropdown box.

    I did not do this for my game that I made (and posted earlier in this thread) and I should have. At some point I’ll go update it to fix that. Cuz let me tell you, it was a PAIN to update the virtually identical code in every single square for some silly little mistake when I was in the process of creating it. Oof.

    I hope that makes sense. If you need additional explanation or help, let me know.