Can we give Form Action any name?

For example if i wish to make registration in form element can i give action any name? For example < form action = “/submit-user” > can i use it like this?

Not really, it refers to where you send the form to, so it’s constrained by the URI/URL/etc for that service/resource/etc. If you control that (like you have say a PHP file that does it) you can call that resource anything you like and the action attribute would be the same.

If there are some special rules, like the action is only a placeholder and everything gets handled by something else then sure

The value of the action attribute refers to the location of a file (script typically) which will process the form upon submital. When you write action="/submit-user", you are referencing a URI located locally called “submit-user” or a default file in a local directory called “submit-user”. As long as you have such file, then your form will be processed by it.

1 Like

you can always give the form an id