I'm currently trying to use FormItBuilder which I think is pretty neat so far. But the problem I now have is that the action is making use of a relative path which posts the form to a page that does not exist.
The page I have my form on is '/membership/register.html' and the action on the form is 'membership/register.html' so when it posts, it posts to '/membership/membership/register.html'
How can I fix this or even change the action attribute of the form?
PS - I'm using modx 2.2.1
Hi EvoBunny,
I code FormItBuilder and I'd like a more flexible solution to this. There is no reason why I can't use the default form action "[[~[[*id]]]]" but allow this to be overwritten by whatever you like (e.g. passing arcuments as shown in your example. Obviously for the form to process the snippet tag must be placed into the resource that is going to handle the form processing.
I must admit though, I'm not sure why exactly you are ending up with the form action posting to a different page to what you are starting on. Generally [[~[[*id]]]] should translate into a link that should work for you no matter what your friendly url (or lack of) setup you are using.
What are your thoughts?
Hi,
Might be a modx settting (or error?) but when you place the form in sub folder (logically in this case) it tends to append the url is generates to the sub folder, especially when friendly url's are enabled.
I'll give an example like the one above:
Let's say you have your page with the form is located in: /members/register.html
Then the "[[~]]" link to that page it generated in the form action is: members/register.html
This means that when the form is submitted, it gets submitted to /members/members/register.html
Now I believe it does this because it's a relative path "members/register.html" and the browser sees it being part of a sub folder/path so it appends it to that path thus posting it to "/members/members/register.html"
That's why I was wondering about it being a modx setting perhaps to generate the relative path by default, but by making it an absolute path removes this problem. If the the form was just in the root (i.e. /register.html) then there wouldn't have been any issues with this, but putting it in a sub folder does seem to create the aforementioned problem.
I just can't reproduce that issue. Did you end up resolving that?
-
☆ A M B ☆
- 24,524 Posts
What is the base href setting in the head of the template?
Ah yes nice thinking sottwell. An issue there could certainly produce the issue if not set up correctly.