• 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: Birthday field settings for differend age groups

Birthday field settings for differend age groups 3 years 8 months ago #40445

  • roi
  • roi's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hi,
Using the birthday field, I need to lead the subscribers in different option/payment page if they are above a particular age (63 years old) and on another option if they are below this age.

I used the following code in order to calculate the age of subscribers to a hidden field:

$myBdField = $_POST;

if(date("md") < date("md", date("U", mktime(0, 0, 0, $myBdField, $myBdField, $myBdField)))){
$_POST = (date("Y") - $myBdField) - 1;
}else{
$_POST = date("Y") - $myBdField;
}

My problem is that I cannot add conditions related to that hidden field. Is there another way to do this?
The administrator has disabled public write access.

Birthday field settings for differend age groups 3 years 8 months ago #40452

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

Can you please provide more details on your scenario? Are you using a multi-page form and would like to display a different page based on the user age or would you like to perform a redirect to a different page after the form is submitted?
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.

Birthday field settings for differend age groups 3 years 8 months ago #40457

  • roi
  • roi's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Thank you for your reply.
I'm using a multi-page form and I would like to display a different page based on the user's age:
If the calculated age is <63 they should go to the next page where they will be asked to pay an amount X (ie 100 euros).
If the calculated age is +63 then they should be asked to pay an amount Y (ie 50 euros)
The administrator has disabled public write access.

Birthday field settings for differend age groups 3 years 8 months ago #40458

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

Have you tried taking a look at the following example from our documentation?
www.rsjoomla.com/support/documentation/r...multi-page-form.html
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: gregs, roi

Birthday field settings for differend age groups 3 years 8 months ago #40464

  • roi
  • roi's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Finally, I managed to lead the subscribers in different payment option using a textfield and the following script:

function test_age(ob)
{
//alert(ob.value);

var select = $('payment-476');
select.empty();

if (ob.value < 63)
{
select.adopt(new Option( '€ 110.00 - Below 63 years old', 'Below 63 years old'));
}
else {
select.adopt(new Option( '€ 35.00 - Above 63 years old', 'Above 63 years old'));
}
//<option value="Below 63 years old"> € 110.00 - Below 63 years old </option><option value="Above 63 years old"> € 35.00 - Above 63 years old </option>
/*var select = $('payment-476');

select.adopt(new Option( '€ 35.00 - Above 63 years old ', 'Above 63 years old'));*/

}

and adding a class="sg_hide" on Multiple Products drop down

My issue now is this:After the age entry, there is also a radio selection (YES/NO) and if the answer is yes, then the payment procedure should be ignored, since the subscription is free and by pressing the submit button they should see the "thank you" message. Now it leads to payment gateway instead.
(If I turn the Multiple Products View Type into Radio Group, then the submit button works ok but the script is ignored)
Last Edit: 3 years 8 months ago by roi.
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!