Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react hook form submit outside form

const { handleSubmit } = useForm();
const onSubmit = data => {
	console.log(data);
};

//...

<form id="hook-form" onSubmit={handleSubmit(onSubmit)}>
	{/* your awesome form */}
</form>

<button type="submit" form="hook-form">Submit</button>
Source by github.com #
 
PREVIOUS NEXT
Tagged: #react #hook #form #submit #form
ADD COMMENT
Topic
Name
1+7 =