1. johnnys
  2. General
  3. Wednesday, February 12 2014, 10:06 PM
Hello,

I would like to re-direct the users to a certain URL depending on their selection during registration.

Part of my form has a selection box called 'Year Joined' (id="jform_year_joined";). I have a total of 60 selections in the list. Depending on what year they choose I'd like to re-direct them to a payment page.

For example, anything under year 1995 go to page 1, anything above year 1995 go to page 2.

If you can think of an easier way to do this please let me know.

Thanks,
J
Accepted Answer
admin Accepted Answer
Admin
try this:
replace function getValue
with function getField
  1. more than a month ago
  2. General
  3. # Permalink
admin Accepted Answer
Admin
Hi,
Sorry for late reply, it's night for us.
Tomorrow we will contact you on private message for this personalization.
  1. more than a month ago
  2. General
  3. # 1
johnnys Accepted Answer
Hello,

Thanks for the fast reply, you can however ignore this request as I think I may have a work-around.

If I do need your assistance I shall let you know.

Thanks again.

J
  1. more than a month ago
  2. General
  3. # 2
johnnys Accepted Answer
Hello, I'm back.

I have managed to direct users to an RS Pro Form successfully. The RS Pro form pulls PHP variables 'Name' 'Username' & 'Email' from the EasyProfile DB successfully (using the code below), apart from one field.

//<code>
$user = JFactory::getUser();
return $user->get('name');
//</code>

//<code>
$user = JFactory::getUser();
return $user->get('username');
//</code>

//<code>
$user = JFactory::getUser();
return $user->get('email');
//</code>




I have a drop down field on my EasyProfile form called Year In (year-in) and I would like this to appear on the RS Form also like above, according to their website the code should look something like

//<code>
$db = JFactory::getDbo();
$db->setQuery("SELECT `column_name` FROM `#__table_name` WHERE `column_name`='value' LIMIT 1");
return $db->loadResult();
//</code>


So I have altered it to fit my DB column and table names;

//<code>
$db = JFactory::getDbo();
$db->setQuery("SELECT `year-joined` FROM `#__jsn_users` WHERE `year-joined`='value' LIMIT 1");
return $db->loadResult();
//</code>


Does look like it should work? It just shows a blank field on my RS Form.

I understand that this isn't exactly EasyProfile support directly however if you had the time to have a look I lwuld be most gratefull.

Thanks,
J
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
Hi,
try our API (see http://www.easy-profile.com/docs/38-jsnuser-object.html)

require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser();
echo $user->getValue('year-joined');


You can use this to find all fields, even name,username, email
  1. more than a month ago
  2. General
  3. # 4
johnnys Accepted Answer
uHi,

Thank you for this help.

I have added the code you suggest however it on the form it only picks up the select list 'number' not the select list 'value' if you understand.

My select box has the values below;

1|1929
2|1930
3|1931
4|1932
5|1933
6|1934
7|1935
8|1936
9|1937
10|1938


Whenever I implement the code you suggested above the form only picks up the number not the value, i.e '2' not '1930' and '3' not 1931

Am I doing something wrong?

Thanks again,
J
  1. more than a month ago
  2. General
  3. # 5
johnnys Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.