I wanted to be able to pass an id in the action of the form
example:
action="/numeric id/prefix"
precisely the numeric id must be a variable taken from the current url
I DON'T USE JQUERY
i try this:
<form id="prefix-form" method="post" action="javascript:redictURL('prefix')">
<label for="prefix">Pre</label>
<hr></hr>
<input type="text" name="prefix" id="email" placeholder="&&prefix&&" required>
<input type="submit" value="" id="buttonPrefix">
</form>
the function "redictURL" take the url and add /prefix at the end:
const redictURL = (data) => {
let id = location.pathname.split('/')[1]
return `/${id}/${data}`
}
,but what comes back to me in the end is this and so it doesn't send a post request to the server like I would like