plainblack.com
Username Password
search
Bookmark and Share

Multi-value FormParam Macro

I recently encountered a situation which required submitting values in a multiple-enabled select box to a SQLReport. I struggled for some time before realizing that the standard FormParam macro only returns the first value from such a list. The result is that I had to hack Session.pm, and make a new macro, FormParamArray.pm, to do what I wanted. JT suggested I post it, so here it is.

 Replace your normal Session.pm with the one from the zip file below. Then put FormParamArray.pm  in your Macro directory. Add the line

FormParamArray => FormParamArray, \

into your macro declarations in WebGUI.conf.

 The syntax for using  the new macro in a page is ^FormParamArray(name,offset);

where name is the form control name whose values you want to read, and offset is the numeric ofset from the beginning of the list, starting at zero.

This macro was created in WebGUI 6.2.10. Don't know if it works in ANY other version. 

Enjoy! 

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
DownloadFormParamArray.zip FormParamArray.zip
LinksNo Support Offered
Statistics Downloads: 329
Views: 5075
Rating: 0
Updated: 8/12/2005
Keywords macros
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved