// JavaScript Document jQuery(document).ready(function($) { $('#guestblanks').hide(); $('#addguests').click(function(event){ event.preventDefault(); $('#guestblanks').show(); }); $('#lookupnow').click(function(){ var email = document.getElementById('lookup').value; var eventid = document.getElementById('event').value; $('#e').attr({value: email}); $.ajax({ type: "POST", url: 'http://www.economicforumpbc.com/wp-content/plugins/meeting_group/lookup_ajax.php', timeout: 3000, data: { email: email, eventid: eventid }, success: function(msg) { var data = eval('(' + msg + ')'); if(data.message) { $('#status').html(data.message); $('#status').fadeIn(300); } else { $('#first').attr({value: data.first}); $('#last').attr({value: data.last}); if(data.id) $('#updateid').attr({value: data.id}); if(data.prevguests) $('#prevguests').html(data.prevguests); if(data.reason) $('#reason').val(data.reason); if(data.phone) { $('#profileblanks').attr({style: 'display: none;'}); $('#profileincluded').attr({value: '0'}); $('#status').html('Contact information on file for ' + data.first + ' ' + data.last); $('#status').fadeIn(300); } else { $('#status').html('We would like to get full contact information for you'); } } }, error: function(msg) { jQuery('#status').html('Error: ' + msg.responseText); } }); }); });