My Form Generator sends data to localhost:8100/[object%20HTMLInputElement]

Hi. I have been coding with PHP for ages. And just got Wappler two days ago during the Black Friday offer. The video tutorial from Ken Truesdale helps a lot.

But I am testing the Bootstrap 5 Form Generator, I am getting an error where data is sent to a non existence URL. So through the Developer Tool > Network, I see it got a 404 status. Although, all data Payload is correct though.

So I am wondering what I did wrong.

Welcome to Wappler Iszuddin!
Have you clicked the ‘Make Server Connect Form’ in the form properties panel? Select the form and expand the App Structure Panel to the right, and if not already done so, tick the button marked 'Make Server Connect Form’. See if that rectifies your issue…?

You mean like this? I set the API to cars. So here’s my cars API too.

Looks correct, with regards to what I suggested above. Silly question, is the Submit button contained between the form tags, and not outside of them?

Not a silly question. But the button is not from the form. I added a different button to submit the form

Dynamic Event > Mouse Click > Flow Editor

I have in my Flow Editor

  • Conditions to set the “action” query parameter to insert or update
  • Run - Submit form

Well, the script triggers correctly. Just that it’s not sending to the right URL.

Do you have a forks or value called “action” under the form - it seems to overwrite the form action.

Most probably an input in your form has a name="action"
Please see:

ooOOOoooOOooo … yes I do. I have POST parameter for the API that I set to action. I was using it to determine where to insert or update the data. I changed it to operation and now it works.

Thanks!

It’s working now. Thanks

1 Like

Would it be worth disabling the ability to use ‘action’ as a name…? Maybe a notification to explain this name can not be used for this purpose?

There are a few other such reserved keywords as well, from what I remember. A doc with collection of those would make more sense than trying to figure out in Wappler code and showing a notification there.