everyone, I'm using a javascript to do a form popup on a page. The form is included rather than being directly a part of the page.
When I click on hyperlink the form only shows for a second then disappears. It works if I literally create the form in the same page instead of including it as a php file.
I believe it's the hyperlink that's refreshing the page. How can I prevent my hyperlink from refreshing the page?
<?php < scripttype = "text/javascript" >
function deselect(e)
    {
    $('.popUp') . slideFadeToggle(
   function ()
    {
    e . removeClass('selected');
    });
}
$(
function ()
{
$('#edit') . on('click',
function ()
    {
    if ($(this) . hasClass('selected'))
        {
        deselect($(this));
        }
      else
        {
        $(this) . addClass('selected');
        $('.pop') . slideFadeToggle();
        }
    return false;
    });
$('.close') . on('click',
function ()
    {
    deselect($('#edit'));
    return false;
    });
});
$ . fn . slideFadeToggle =
function (easing, callback)
{
return this . animate(
    {
    opacity:
        'toggle', height:
            'toggle'
            }
        , 'fast', easing, callback);
        };
</script>
Here's the form that is in a seperate file...
<div id="contactInfoDiv" class="fluid popUp">
<form id="updateForm" method="post" action="editContact.php">
<pre>
First Name:   <input type="text" name="firstName" value="<?php echo    $firstname;?>"><br>
    Last Name:    <input type="text" name="lastName" value="<?php echo  $lastname;?>"><br>
    Address:      <input type="text" name="address" value="<?php echo $address;?>"><br>
    Phone:        <input type="text" name="phone" value="<?php echo $phone;?>"><br>
    Email:        <input type="email" name="email" value="<?php echo $email;?>"><br>
<input type="submit" name="update" value="Update"><br>
</pre>
</form>
    </div>
Edit
What I'm trying to do is just include the above form like this:
<?php include("editContact.php");
<a href="userProfile.php" id="edit">Edit</a>
UPDATE:
I added e.preventDefault() like the following:
 <script type="text/javascript">
 function deselect(e) {
  $('.pop').slideFadeToggle(function() {
 e.removeClass('selected');
    });
   e.preventDefault();
 }
   $(function() {
   $('#edit').on('click', function() {
 if($(this).hasClass('selected')) {
  deselect($(this));               
} else {
  $(this).addClass('selected');
  $('.pop').slideFadeToggle();
}
 return false;
 });
  $('.close').on('click', function() {
  deselect($('#edit'));
   return false;
   });
});
 $.fn.slideFadeToggle = function(easing, callback) {
return this.animate({ opacity: 'toggle', height: 'toggle' }, 'fast', easing,      callback);
 };
 
     
     
    