• 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: How to display dropdown selected text ? not value

How to display dropdown selected text ? not value 9 years 7 months ago #32913

Hi,
I have a dropdown field in my form with that kind of input:

b47thp|myproduct

the first element (the value) is used to send the form to php script.
I would like the second element appear in my admin email.

the problem is that {myfield:value} and {myfield:text} give me the same thing, the value !

How to display the selected text from a dropdown ?
The administrator has disabled public write access.

How to display dropdown selected text ? not value 9 years 7 months ago #32918

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
This is the correct way (using the "text" placeholder), but for some reason it is not working properly on your end. Do you have the form setup for multiple languages ? Can you post the complete item list ?
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.
The following user(s) said Thank You: Sciuridae

How to display dropdown selected text ? not value 9 years 7 months ago #32927

Thank you alexp for your answer,
yes my form setup is multiple languages, is that matter ? how can I change that ?

my field is populate from an XHR request with a script :
for(var i = 0; i < arr.length; i++) {
	out += "<option value="+ arr[i].uid +" >" + arr[i][field] + "</option>";
}
document.getElementById(selectId).innerHTML = out;

the actual list is:
<select name="form[selTraining][]" id="selTraining" onchange="selectChange(this)" class="rsform-select-box">
<option></option>
<option value="e4fa8905">Élaborer un projet professionnel</option>
<option value="a3c0258c">Cadre legal et financement de la formation professionnelle</option>
</select>
The administrator has disabled public write access.

How to display dropdown selected text ? not value 9 years 7 months ago #32928

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
The language would have posed an issue, if the items weren't configured properly, but it seems that is not the case with your implementation.

Given that your items are provided by a Javascript and stored in the actual RSForm!Pro database, you won't be able to get the text label via the specialized placeholder. You will notice that if you set the items (like you would normally do) these will work.

The reason for this, is actually simple: just the value part is ends up in the $_POST variable (and then processed and saved).

To handle the "text" placeholder, RSForm!Pro checks what value has been submitted to the database and then grabs the corresponding label from within the field configuration.

If this is a must for you, you might try adding a hidden field for your form that will store the label separately.
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.
The following user(s) said Thank You: Sciuridae

How to display dropdown selected text ? not value 9 years 7 months ago #32929

I see.
I thought the problem was from dropdown item, but it's just my way to use it.
have to try the hidden field.

Thank you very much alexp
Last Edit: 9 years 6 months ago by Sciuridae.
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!