如果上一个文本框有值,则光标焦点移动到按钮

I'm using rfid reader that the student will tap their id and after that it will display their basic info, i have a hidden button on my form, if click it will open a modal that contains several purposes that the student will choose,

Now my problem is on how to move the focus of the cursor the the button and automatic click it if the last text box has value.

Hope you can help me or give me an idea.

Probably better of firing a javascript function onclick and then either:

  • Using a function to send formdata via an AJAX function (See this page), or
  • Using javascript to change window.location