"action" cannot be used as a name attribute within a form

Wappler Version : 3.3.6
Operating System : php or node

Expected behavior

When adding an input to a form, the name attribute should be able to be set to “action”

Actual behavior

The following input:

<input type="text" class="form-control" id="inp_action" name="action" aria-describedby="inp_action_help" >

produces the following request url:

https://wappler.uniqueideas.com/[object%20HTMLInputElement]

however, changing the name attribute to “operation”, works fine.

You a similar issue if binding data in a form such as for dmx-bind:value if it is within a repeat. If the input name is the same as the binding e.g. <input type="text" name="somevalue" dmx-bind:value="somevalue"> it will produce an [object OBJECT] value. I had to give some SC fields aliases recently to overcome this.

HI Ken,
You should not use names that are used for HTMLFormElement properties. Here’s a list of these properties:

So you need to be careful when using action as an input name as it will collide with the value of the action attribute of your form.

1 Like