• 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: Multiple product paypal- check value by Javascript

Multiple product paypal- check value by Javascript 10 years 10 months ago #28009

Hello, I have created a form with multiple product paypal, titled "Pacco 1" with 4 values ​​within:

The following values​​:
Choose...
Value 1 | X €
Value 2 | X €
Value 3 | X €


Now I want to create a control Javascript, if the product multiple paypal named "Pacco 1", the value is equal to "Choose..." then show alert with custom text.

How can I do? I know it's very simple, but do not understand much about javascript, I can not understand how the logic of language.

Could ye help me?
Thanks in advance!
The administrator has disabled public write access.

Multiple product paypal- check value by Javascript 10 years 10 months ago #28020

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
Well you will have to insert a code like the one below in the CSS/JAVASCRIPT section of your form.
<script type="text/javascript">
function checkDrop(theForm) {
if (document.getElementById('field_name').value == "your_dropbox_value")
{
alert('Custom text of alert!')
return false;
}
else {
return true;
}
}
</script>
After this you will have to add a trigger to the dropdown field by inserting the following line in the additional attributes :
onchange="checkDrop('field_name');"
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

Multiple product paypal- check value by Javascript 10 years 10 months ago #28031

cosmin.cristea wrote:
Well you will have to insert a code like the one below in the CSS/JAVASCRIPT section of your form.
<script type="text/javascript">
function checkDrop(theForm) {
if (document.getElementById('field_name').value == "your_dropbox_value")
{
alert('Custom text of alert!')
return false;
}
else {
return true;
}
}
</script>
After this you will have to add a trigger to the dropdown field by inserting the following line in the additional attributes :
onchange="checkDrop('field_name');"

This syntax is correct?

<script type="text/javascript">
function checkDrop(theForm) {
if (document.getElementById('Pacco 1').value == "Scegli...")
{
alert('Custom text of alert!')
return false;
}
else {
return true;
}
}
</script>

Additional attributes :

onchange="checkDrop('Pacco 1');"
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!