• 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: Pass Value of Drop-Down to Populate New Drop-Down?

Pass Value of Drop-Down to Populate New Drop-Down? 10 years 10 months ago #28098

  • contact13
  • contact13's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
  • Thank you received: 5
I'm trying to pass the value of a drop-down menu via URL to another form. From there, I'd like to auto-select that drop-down item based off the value.

In other words, I have two drop-downs in different forms which are identical. Call the drop down item "proof"

Inside that drop-down, there are two options: "Fax" and "Upload"

My URL that I'm passing looks like the following, and is not working. I have bolded the selection that is in question.

mysite.com/index.php?option=com_rsform&formId=4&submissionId=4&form[proof]=Upload

Obviously I'm not doing that correctly. However- is there another way to do it? I've read THIS ARTICLE a dozen times, and can't figure it out.

I know how to pass the value to a text field, but I'm trying to set up additional conditional fields based off of this drop-down. I can change it to a Radio Button if needed, but I don't know that I'd get any better results.

Any help would be greatly appreciated!
Last Edit: 10 years 10 months ago by contact13.
The administrator has disabled public write access.

Pass Value of Drop-Down to Populate New Drop-Down? 10 years 10 months ago #28100

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
Dropdown fields are basically arrays that contain mutiple elements, correct syntax would be form[proof][] e.g.:

mysite.com/index.php?option=com_rsform&f...&submissionId=4&form[proof][]=Upload
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

Pass Value of Drop-Down to Populate New Drop-Down? 10 years 10 months ago #28102

  • contact13
  • contact13's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
  • Thank you received: 5
mysite.com/index.php?option=com_rsform&f...&submissionId=4&form[proof][]=Upload

Still doesn't seem to be getting it. Is there anything in the custom JS or PHP that I need to be adding to force this parameter to be passed? Below is what I have in Custom PHP as of now:
$submission_value = JRequest::getVar('submissionId');  
list($replace, $with) = RSFormProHelper::getReplacements($submission_value);
$formLayout = str_replace($replace, $with, $formLayout);

Thanks. I really appreciate everyone's help!
The administrator has disabled public write access.

Pass Value of Drop-Down to Populate New Drop-Down? 10 years 10 months ago #28111

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
To have this functionality, you will have use a version above RSForm!Pro 02 April 2014 - Version 1.49.0.

The syntax i provided is correct to catch a parameter from the URL.

index.php?option=com_rsform&formId=5&form[dropdown_field][]=value

For version before you can use this method:
The link syntax should be :

index.php?option=com_rsform&formId=5&myparameter=item1

Use the following code in the Items field of the Dropdown:
//<code>
$myparam = JRequest::getVar('myparameter');
$myarray = array('item1', 'item2', 'item3');
$items[] = "|Please Select";
foreach($myarray as $arr){
       if($arr == $myparam){
               $items[] = $arr.'[c]';
       }else{
               $items[] = $arr;
       }
}
return implode("\n",$items);
//</code>
My help is not official customer support. To receive your support, submit a ticket by clicking here
Last Edit: 10 years 10 months ago by cosmin.cristea.
The administrator has disabled public write access.
The following user(s) said Thank You: contact13

Pass Value of Drop-Down to Populate New Drop-Down? 10 years 10 months ago #28115

  • contact13
  • contact13's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
  • Thank you received: 5
That got it. THANK YOU!
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!