url: 'personnel_contactdetails.php?id%5B%5D='+ids.join('&id%5B%5D=')+'&what='+$('#what').val()+'&how='+$('#how').val(), processData:false, success: function(data) { if( $('#how').val() == 'email' ) $("#actiontrigger").attr('href', "mailto:?bcc="+encodeURI( data.join(';') ))[0].click(); else $("#actiontrigger").attr('href', "sms://"+encodeURI( data.join(';') ))[0].click(); }, error: function(err,msg){ alert(err); alert(msg); return false; } }); }); var names = jQuery.parseJSON( '<?php echo str_replace("'", "\\'", json_encode($ATC->get_activity_names())); ?> ' ); $('#title').autocomplete({ source: names, minLength: 0 }); var locations = jQuery.parseJSON( '<?php echo str_replace("'", "\\'", json_encode($ATC->get_locations())); ?> ' ); // Autocompletes need a label field to search against $.each(locations, function(){ $(this)[0].label = $(this)[0].name + " " + $(this)[0].address; }); $('#location').autocomplete({ minLength: 0, source: locations,