1. FotoHijinx
  2. General
  3. Sunday, November 29 2015, 05:24 AM
For example I ask users what their Council is and I have created a drop down list for all the Councils available.

My client has asked whether we can have the chosen Council's address, website, fax no automatically filled in once they have selected their Council. Is this possible?

Cheers
Irene
admin Accepted Answer
Admin
HI,
you can't do this natively, but there are still other ways to do this, here 2 examples (you can implement both or only one)

Client side method
You can add a simple javascript, when select field change then you update values of others fields.

Server side method
You can do this by writing a simple plugin, follow these instructions
- Download, Install and Enable our skeleton plugin (you will find at page http://docs.easy-profile.com/index.php/article/triggers)
- Open file /plugins/jsn/skeleton/skeleton.php
- Remove samples functions like triggerFieldAvatarUpdate and triggerProfileUpdate
- Add a function that do this:
public function triggerProfileUpdate($user,&$data,$changed,$isNew){
if($data['council']=='council1')
{
$data['council_address']='address1.....';
$data['council_fax']='123456788';
$data['council_website']='http://xxxx.com';
}
if($data['council']=='council2')
{
......
}
if($data['council']=='council3')
{
.....
}
}

With this you fill Address,Fax an Website value based of another value.

NOTE 1: We not know your scenario, so we can't be more precise in suggest the most suitable solution or if exactly what you want is possible.
NOTE 2: This code is only for example purpose, not tested and not supported.
  1. more than a month ago
  2. General
  3. # 1
  • 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.