Welcome guest,

You have 1 votes remaining.

1 votes
none
Subscribe

Dropdown field with Silent Post

by fonny on 15 Sep 2015 08:39 | 726 Hits | 0 comment(s)

May I suggest a correction?

Dropdown fields with single input attribute and send via Silent Post are now send as array type
e.g. (country[]:Belgium ) where most sites expect a single (string) value (eg country:Belgium)

Code change could be:
In administrator/components/com_rsform/helpers/rsform.php starting line 2378. (rsforms pro v1.5.24)


foreach ($post as $key => $value)
{
if (is_array($value))
foreach ($value as $post2 => $value2)
if (sizeof($value) > 1)
$data[] = urlencode($key).'[]='.urlencode($value2);
else
$data[] = urlencode($key).'='.urlencode($value2);
else
$data[] = urlencode($key).'='.urlencode($value);
}

This will check for single input array fields.
If only 1 value is posted the input will be a string, not an array. Result of an dropdown list is no longer an array.

Thanks

1000 Characters left

How many votes ?×

Please select the appropiate flag ×

Spam Inappropriate Duplicate Wrong Category

Please select the category