[Bug 1.4.1.7?]Form submit arguments and input values
Posted: Tue Nov 07, 2017 8:31 pm
I think I may have found a bug. If I enter an argument value as a part of the <form action> it just concatenates the value to any <input> values passed to the processing macro in macro.args. The method is set to json. The input values are done correctly and put in to a json array. But the arguments set in the action (see Wiki: macroLinkText()) are oddly added to json. So, if I just put "test" as an argument and let's say I had no input other than submit value="test2" then my macro.args would look like this:
This is not a json. Looks like there is no comma and the quote is in the wrong place.
This is what I would expect.
If I had a json array, like ["test","test1"] as the argument, then it would be:
OR (probably better as)
As is the above format gives an error because of the bad formatting.
If I had a json object like this: {"test":1,"test1":2}, then I would expect this:
All the argument data would be in the 0 index of the array and input data in the 1 index. If there was no argument with the json method then it would pass a json object. Checking the macro.args type would be a good way to know if there was argument data.
For now, the workaround is not to use the argument parameter with the json method. If you need to have a set argument, then use <input type=hidden>.
---
Also, if someone does try to tackle this, there's also this: http://forums.rptools.net/viewtopic.php ... 5&#p263585
Look at the next post in thread by me for the TL;DNR.
---
Let me add to this. When I pass as part of the value of an input, like when I format the text on a submit button, the form processes it as %EF%BF%BD which gives me the little square value which I assume is MT's unknown character. In my case, this isn't important but it's unexpected behavior.
Code: Select all
["test{"submit":"test2"}"]
This is what I would expect.
Code: Select all
["test",{"submit":"test2"}]
Code: Select all
["test","test1",{"submit":"test2"}]
Code: Select all
[["test","test1"],{"submit":"test2"}]
If I had a json object like this: {"test":1,"test1":2}, then I would expect this:
Code: Select all
[{"test":1,"test1":2},{"submit":"test2"}]
For now, the workaround is not to use the argument parameter with the json method. If you need to have a set argument, then use <input type=hidden>.
---
Also, if someone does try to tackle this, there's also this: http://forums.rptools.net/viewtopic.php ... 5&#p263585
Look at the next post in thread by me for the TL;DNR.
---
Let me add to this. When I pass as part of the value of an input, like when I format the text on a submit button, the form processes it as %EF%BF%BD which gives me the little square value which I assume is MT's unknown character. In my case, this isn't important but it's unexpected behavior.