I suggested that he tried posting to an agent/used my HttpRequest class. This didn't work, as each checkboxvalue is sendt as a single parameter.
E.g. ...make_report?OpenAgent&user=tom&user=jane&user=jack
The previous version of the class only fetched the last parameter.
Dim request As New HttpRequest()
Print request.parameter("user")
' Prints jack
I updated the code, so that the class aggregates the values into a
Dim request As New HttpRequest()
Print Join( request.parameter("user"), "," )
' Prints tom,jane,jack
>> The class in a txt-file
Share and enjoy!
3 comments:
Wouldn't it be more "correct" if the request.parameter returned an array?
I know I can just split it and get an array easily, but it just seems (to me at least) that it should be an array.
Btw, liking your approach, and thinking of "borrowing" parts of it for my own HttpSession class :)
I chose using a string due to simplicity. Most of the parameters you're going to deal with are single parameter types.
Dealing with values from multi select lists/checkboxes is somewhat of a rarity.
I am however going to rewrite the class to use an array internally to concatenate the values. This to make the concatenation more effective/less memory hungry. The class should be updated by 12 CET.
Argh! Forgot one thing.. If the "multi-select"-parameter contains a comma, the developer using the class is screwed..
To keep the usage simple, I'm going to return a variant. In case of a multi-select parameter, I'll return a dynamic array, else a String.
Post a Comment