RPTools.net

Discussion and Support

Skip to content

It is currently Fri Nov 17, 2017 12:33 pm 




Forum rules


Posting now open to all registered forum users.



Reply to topic  [ 1 post ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7947
Location: Bay Area
 Post subject: [Bug 1.4.1.7?]Form submit arguments and input values
PostPosted: 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:

Code:
["test{"submit":"test2"}"]


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.

Code:
["test",{"submit":"test2"}]


If I had a json array, like ["test","test1"] as the argument, then it would be:

Code:
["test","test1",{"submit":"test2"}]

OR (probably better as)
Code:
[["test","test1"],{"submit":"test2"}]


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:

Code:
[{"test":1,"test1":2},{"submit":"test2"}]


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: viewtopic.php?f=21&t=26731&p=263585&#p263585

Look at the next post in thread by me for the TL;DNR.

---

Let me add to this. When I pass &nbsp; 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.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 1 post ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 3 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman