Join the Webstudio community

Updated 4 weeks ago

The problem with action URL in forms

Friends, tell me what is the problem with action URL in forms
I made a simple form with one field and a button, I try to send a webhook to n8n - and it doesn't go away.
in the action field I write the necessary webhook URL I publish the site - but there it is not “action=” in the code.....
what the hell? do the forms even work?
Attachments
Screenshot_2024-09-28_at_18.40.01.png
Screenshot_2024-09-28_at_18.40.14.png
B
a
O
24 comments
Is it form or webhook form?
this is form from forms
Try webhook form instead
It will hide webhook auth on server
The result also the same... action specified in webstudio does not correspond to what I see in the code, and naturally nothing is sent by webhook.
Attachments
Screenshot_2024-09-28_at_19.13.37.png
Screenshot_2024-09-28_at_19.13.47.png
And this is expected. The real action is added on server to hide auth token from client side
Missing action in regular form seems like a bug
ok
test form (standart webhook form) - just edited field names and action
https://launey-a378t.wstd.io/ru/test-form

test webhook URL (post method as it is in code), that is in action field in webstudio
https://n8n.navi.training/webhook-test/799035af-fc66-48bb-bd5c-66dad4df3219

what can be wrong?
I think need to start listening for test webhook on n8n side
Alright, this
Attachment
image.png
type=button does not submit form
type=submit does
did you set it?
That's weird, I don't think I did.
but if you create a new one WF, it is set to submit
I probably accidentally hooked it.
Thanks!

But it still doesn't work after switching.
Attachment
Screenshot_2024-09-28_at_19.43.53.png
tested a new webhook form and button is type submit by default
Thanks for your patience friends! I think I figured it out, the problem was probably in the way the URL was inserted in the action field.
I deleted everything and put it back together again and it worked.
Was it some browser autocomplete?
No it's probably a minor bug, but because I'm not yet familiar with webstudio.
I'm not sure I can replicate it.
I first tried adding a URL to the action field via expression editor, when it didn't work I deleted the expression and added in quotation marks again it didn't work, and then without quotation marks and changed the url a few more times. Probably after the first two operations something remained and although in the visual environment everything looked right. I deleted the form and created a new one, then it worked.


and another question how to add form success URL (thank you page) to use it instead of a standard message?
success message or a completely separate success page?
success message is part of the component, you can drop there any instance and even make it fulscreen if needed, but if you want a separate page, currently requires this workaround:

https://github.com/webstudio-is/webstudio/issues/3530#issuecomment-2317596011
Thank you! That's an interesting way to do it, I'm going to try it now!
Add a reply
Sign up and join the conversation on Discord