Мне действительно нужно, чтобы это всплывающее окно (fancybox) закрывалось, когда пользователь отправляет форму ... Прямо сейчас, оно перенаправляется на ту же форму (signup.php) через 2 секунды, но я хотел сказать спасибоВаше сообщение затем закрывает окно ...
<h1>SIGN UP</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<?php if($form_complete === FALSE): ?>
<div id="newsletter">
<!-- <div id="fancybox-close1"><a href="#" onClick="parent.jQuery.fancybox.close();"><img src="js/fancybox/fancy_close.png" /></a></div> -->
<form id="form" name="form" method="post" action="signup.php">
<label></label>
<fieldset>
<label>Name: <?php if(in_array('name', $validation)): ?><span class="error"><?php echo $error_messages['name']; ?></span><?php endif; ?><input type="text" id="name" name="name" value="<?php echo isset($_POST['name'])? $_POST['name'] : ''; ?>" onFocus="this.value=''" maxlength="255"></label>
<label>Surname: <?php if(in_array('name', $validation)): ?><span class="error"><?php echo $error_messages['surname']; ?></span><?php endif; ?><input type="text" id="surname" name="surname" value="<?php echo isset($_POST['surname'])? $_POST['surname'] : ''; ?>" onFocus="this.value=''" maxlength="255"></label>
<label>Position: <?php if(in_array('name', $validation)): ?><span class="error"><?php echo $error_messages['position']; ?></span><?php endif; ?><input type="text" id="position" name="position" value="<?php echo isset($_POST['position'])? $_POST['position'] : ''; ?>" onFocus="this.value=''" maxlength="255"></label>
<label>Organization: <?php if(in_array('name', $validation)): ?><span class="error"><?php echo $error_messages['organization']; ?></span><?php endif; ?><input type="text" id="organization" name="organization" value="<?php echo isset($_POST['organization'])? $_POST['organization'] : ''; ?>" onFocus="this.value=''" maxlength="255"></label>
<label>Email: <?php if(in_array('email', $validation)): ?><span class="error"><?php echo $error_messages['email']; ?></span><?php endif; ?><input type="text" id="email" name="email" value="<?php echo isset($_POST['email'])? $_POST['email'] : ''; ?>" onFocus="this.value=''" maxlength="255"></label>
<input type="submit" id="submit" name="submit" value="SIGN-UP">
</fieldset>
</form><!-- end sign up form -->
<?php else: ?>
<div class="thankyouMessage">Thank you for subscribing!</div>
<script type="text/javascript">
setTimeout('ourRedirect()',2000)
function ourRedirect(){
location.href='signup.php'
}
</script>
<?php endif; ?>