I have this button on a novalidate html form and I’m trying to get it to redirect to another webpage, while keeping the original functionality of creating an account.
<button class="yWSHVqDY3QXtLSenwRoA" data-test="create-account-create-button" type="submit"><span>Create account</span></button>
The end goal is for when a user creates an account, the button automatically redirects them to a payment page. I’m super new to coding, so I’m not sure if this is possible, but any help is appreciated!
2
Answers
click
andkeydown
event listeners to your rescue.In a form you would use the action attribute to specify where the form submit to.
If you have more buttons in the same form you can use the formaction attribute on the button to override the default: