Submit, can get different values in the same list.

<form id="form">

<button class="" type="submit" id="submit" data-type="normal-pay">
              
            </button>
            <br><br>
            <button class="" type="submit" id="quick-pay-button" data-type="quick-pay">
              
            </button>
            
</form>
$("-sharpform").on("submit", (event) => {

event.preventDefault();
  var type = event.currentTarget.dataset.type;

can I get the data-type value from the custom button in this way?
even if it"s all the same submit function?
or is there a better way? The purpose of
is that I want to get several different button values and do different things in the same list.
because I found that if you want to catch data-type, you have to be on form

.

you can change type to button. Do not use submit


I don't know what you want to do, but if you want to submit a form, HTML's own is enough

Quick</button>
</form>

the name of the two button [type=submit] are the same. Buttons (including input and button ) only the name - value pairs that are clicked on type=submit will be submitted.

if you want to process data in JS, simply bind the click event to each button . You don't need type=submit .

Menu