I am aware that you normally add a ‘form button’.
Thing is that I’d like to reuse our button which is made with multiple divs and interactions.
If I am not mistaken you cannot build upon a form button and add ‘layers/divs’ for advanced styling.
So the question basically is how can we change our custom button into a ‘input type=submit’ ?
Thanks for starting this thread. I was just looking for this very solution.
I’m having an issue where the artwork inside the button wrapper is not being “active” so when the mouse rolls over the arrow in the center for example the button isn’t clickable. I styled it exactly as you suggested.
I know this question was asked a while ago, but I have just found a solution that covers a lot of issues.
Wrapping the submit button in a div does allow you to style it however you want, including interactions & animations. The problem however is that when the submit button (the official one that submits the form) is a child of any other wrapper div it becomes unclickable and users can no longer submit the form. You can get around this by adding the following custom code:
Where ‘btn-wrapper’ is the class you want clicks to pass through or ignore and ‘submit-btn’ is the class you want to be clickable.
‘pointer-events: none’ - makes the wrapper div “clickthrough” or invisible to clicks, but then you also have to add ‘pointer-events: auto’ to any child classes of the class you have made invisible. This makes them visible to clicks again.
For anyone still looking to do this - Here’s a super easy way to make any element function as a submit button - this link blow has the tutorial, cloneable, and code embed!