Submit a form on page load

Ahh I see, makes sense, kind on like a cookie notification would have to do where you do not want to ask the user on every page load and rather store that the user has already accepted your cookies or notification in this case.

Teodor wrote a great post on this here, I think this will help.

Basically you can do this without a form though, all you need is a server action with a database update or insert, and if the notification shows then tell the notification to write a 1 to the database field.

1 Like