• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Need _POST info for multi select dropdown from SQL

Need _POST info for multi select dropdown from SQL 8 months 1 week ago #43595

I have a form with a dropdown field name Students that is populated from code that populates the items array with a numeric id as the value, and a name as the label. That all works correctly. When the form is submitted, my mappings are pushing the data into the correct database fields. When I select multiple objects from this dropdown, the data is inserted as number-comma-space-number-comma-space-number. I am needing to eliminate the spaces so what is inserted is just number-comma-number-comma-number. I need '5,10,15' but what I am getting is '5, 10, 15' instead. I am trying to create a Script called on form process to do a str_replace to replace the spaces with nothing. I don't seem to be able to determine what the $_POST syntax is for this variable. I have tried $_POST , $_POST[0] , and $_POST[index]. I have tried setting all 3 of these variables to something unique in the script just to see if the variable works, but none of them do.

Does anyone have an idea what variable I should be using to update the POST data?
The administrator has disabled public write access.

Need _POST info for multi select dropdown from SQL 8 months 1 week ago #43600

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 245
  • Thank you received: 64
Had to remind myself how to deal with arrays in RSform, try this:
// Get the sequence from the POST data
    $sequence = $_POST['form']['your_field_name'][0];
 
    // Remove all spaces from the sequence
    $cleaned_sequence = str_replace(' ', '', $sequence);
 
    $_POST['form']['your_field_name'][0] = $cleaned_sequence;
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
Last Edit: 8 months 1 week ago by iceferret.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!