• 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: asign value to drop down box with parameter url

asign value to drop down box with parameter url 14 years 6 months ago #11852

Hello.

I have a url link like:

www.mywebsite.com/index.php?option=com_r...&myparameter=myvalue

to call a form.

Then "myparameter" its a value of a dropdown box.

How i can catch the values and display the value as selected this dropdown box?

URL:
www.mywebsite.com/index.php?option=com_r...ormId=1&myparameter=Op5

Dropdown:

op1 $ 1
op2 $ 2
op3 $ 3
op4 $ 4
op5 $ 5This must be displayed selected in the form

Somebody can please tell me how can I do this "step by step".
thanks in advance
The administrator has disabled public write access.

Re:asign value to drop down box with parameter url 14 years 6 months ago #11892

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 12 years 2 months ago by octavian.
The administrator has disabled public write access.

asign value to drop down box with parameter url 12 years 2 months ago #21488

I can catch a parameter from my code, but i can not assign it as a default value to my dropdownlist. Can anyone help me?

Kind regards,
René
The administrator has disabled public write access.

asign value to drop down box with parameter url 12 years 2 months ago #21513

  • mithcd
  • mithcd's Avatar
  • OFFLINE
  • Banned
  • Posts: 38
Looks like this issue needs to be duplicated. Should a support ticket needed to be made here?
First, solve the problem. Then, write the code.
The administrator has disabled public write access.

asign value to drop down box with parameter url 12 years 2 months ago #21536

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
mithcd wrote:
Looks like this issue needs to be duplicated. Should a support ticket needed to be made here?

The customer support service does not provide custom scripting or customizations.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

asign value to drop down box with parameter url 12 years 1 month ago #22526

  • mark.brindley
  • mark.brindley's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Hi,

I just had the same issue a great developer friend of mine help me resolve this.

Create a Drop Down Item
In the Items Field Add this code
//<code> 
 
$options = array('Option 1', 'Option 2', 'Option 3', 'Option 3');
 
$selected_option = JRequest::getVar('myparameter');
 
$items = "|Please Select\n"; 
 
foreach ($options as $options_item) {
 $items .= $options_item."|".$options_item;
 
 if ($options_item == $selected_option) {
  $items .= "[c]\n";
 } else {
  $items .= "\n";
 }
}
 
return trim($items); 
//</code>

Now you can pass your param in the url: myparameter=Option 1 and it should get the required value.

PS: a working version can be seen here: Working Demo

Benefit Option = p=Private%20Choice
Adults = a=2
Children = c=3
Last Edit: 12 years 1 month ago by mark.brindley.
The administrator has disabled public write access.
The following user(s) said Thank You: service20
  • 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!