livesearch field id has changed
Jamroom Developers
??? its not a class on the text field?
$(".live_search_mymod_profile").on( "change", function() {
var id = $('.live_search_text').attr('id');
id.on( "change", function() {
var id = $('.live_search_text').attr('id');
$('#' + id).on( "change", function() {
$_tmp = array(
'name' => 'profile_user_id',
'group' => 'admin',
'label' => 'profile owner',
'help' => 'What User Account should this profile be created for? The User Account selected here will have admin capabilities for the Profile.',
'type' => 'live_search',
'target' => "{$_conf['jrCore_base_url']}/{$_post['module_url']}/get_profile_users",
'required' => false,
'validate' => 'number_nz',
'form_designer' => false // We do not allow the form designer to override this field
);
jrCore_form_field_create($_tmp);
//------------------------------
// get_profile_users
//------------------------------
function view_jrProfile_get_profile_users($_post, $_user, $_conf)
{
jrUser_admin_only();
$lim = 12;
if (!empty($_post['limit']) && jrCore_checktype($_post['limit'], 'number_nz')) {
$lim = (int) $_post['limit'];
}
$_sc = array(
'search' => array(
"user_name like {$_post['q']}%"
),
'return_keys' => array('_user_id', 'user_name'),
'skip_triggers' => true,
'ignore_pending' => true,
'privacy_check' => false,
'limit' => $lim
);
$_rt = jrCore_db_search_items('jrUser', $_sc);
$_sl = array();
if ($_rt && is_array($_rt) && is_array($_rt['_items'])) {
foreach ($_rt['_items'] as $_v) {
$_sl["{$_v['_user_id']}"] = $_v['user_name'];
}
}
return jrCore_live_search_results('profile_user_id', $_sl);
}
var id = $('.live_search_text').attr('id');