UNPKG

@astro-utils/forms

Version:

Server component for Astro (call server functions from client side with validation and state management)

7 lines (6 loc) 243 B
export function addOnSubmitClickEvent(buttonId, allProps) { if (buttonId) { allProps["data-submit"] = buttonId; allProps.onkeypress = `__enterToSubmit(event)${allProps.onkeypress ? ';' + allProps.onkeypress : ''}`; } }