New to nsbasic in javascript - trying to get a button to go to another form


#1

Using javascript, I have a bootstrap4 button and have attached this script to it:

Function btnRegister.onclick() {
  ChangeForm(frmRegister);
  }

I have a formLogin and frmRegister. This is not working.
What do I need to do to make it work in the browser?

Thanks.

Mike


#2

The code you’re showing looks OK, so it’s something else.

  • are there any error messages in the Chrome Console?
  • If you add a console.log("Button clicked") message as the second line, does it show in the console?

Also, a tip: The BS4 Button control has a ChangeForm property. Put frmRegister into it and you don’t need this code.


#3

Got it working - was just written in the wrong language.

Mike