1. msreyes
  2. General
  3. Friday, June 12 2020, 03:09 PM
I have several radiolist options. They are not visible when user signs up which is what I want.

In the field I have set "Default Value" to 0.

My options are:
0|No
1|Yes

What I want is to set these to 0 or No during registration. Right now, doesn't seem to do that for me. It leaves both not selected.
Accepted Answer
admin Accepted Answer
Admin
Hi,
you can do this with a simple plugin, please follow these steps:
- Download, Install and Enable Skeleton Plugin (you will find it at http://docs.easy-profile.com/index.php/article/triggers)
- Open file /plugins/jsn/skeleton/skeleton.php
- Remove samples functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- Add function like this:
public function triggerProfileUpdate($user,&$data,$changed,$isNew){ 
if($isNew) { /* Only new users */
$data['instructor_l1'] = "0"; /* Assign the value */
}
}


NOTE: This code is not tested and not supported, this is only for example purpose. You need to have a minimum of PHP knowledges
  1. more than a month ago
  2. General
  3. # Permalink
admin Accepted Answer
Admin
Unfortunately for some system 0 mean empty, so to keep maximum compatibility I recommend you to user options as following
1|No
2|Yes
and set as default value 1
  1. more than a month ago
  2. General
  3. # 1
msreyes Accepted Answer
Pro
I think I set it right, but still does not set "No" on registration.... anything I might be missing?
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
this happen when you edit a profile or when register a new one? Because default value works also when you register a new profile.
  1. more than a month ago
  2. General
  3. # 3
msreyes Accepted Answer
Pro
This is happening when I register a new profile. I went into the database and they are all NULL.

They work just fine when I go into edit the profile. Just not going to default when I set these default values. One other item to note, these values are not available when someone registers. I don't want them to.
  1. more than a month ago
  2. General
  3. # 4
admin Accepted Answer
Admin
Hi,
sorry but I does not understood well. Can you please send me some other information or site details?

Default value simply fill the input in the registration form, it does not populate DB table.
  1. more than a month ago
  2. General
  3. # 5
msreyes Accepted Answer
Pro
I have this field for example that is NOT available during registration. But during the registration process when the user clicks "SUBMIT" and the user profile is created I would like it to be in the database as "NO".

I think the problem I am having is since I do not publish this under the registration option nothing happens.

So would it be possible to:

  • Maybe add hidden field to run SQL to update this value to NO?
  • Hide this field with a condition during the registration process... user cannot see it, but in behind it is there to populate the database?
  1. more than a month ago
  2. General
  3. # 6
msreyes Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.