简体   繁体   中英

Activate/show fancybox popup on submit form after validating the values in php

Desired Operation : User will fill out the html form and when press the submit button then I want to validate the user type and if it is guest then it should show a fancybox(popup) screen to sign up for that user because I dont want to save values with guest user. The code I have mentioned in the question is fine but HOW CAN I ACTIVATE THE FANCYBOX SCREEN AFTER VALIDATING THE USER.

For this on submit I am checking/validating the session and it is fine I can easily do it using php but fancybox should be shown BUT HOW?

if($_SESSION[FIRST_NAME]=="Guest")
  {
    print '<a id="loginframe" href="Signup.php">Sign Up here</a>';
  }

First do you talk about http://fancybox.net/ ?

You you like to have something like this?

http://jsfiddle.net/mbD8t/

If yes try this:

if($_SESSION['FIRST_NAME']=='Guest')
{
    print '<a id="loginframe" href="Signup.php">Sign Up here</a>';
    print <<< EOL
<script type="text/javascript">
$(document).ready(function() {
   $.fancybox($('#loginframe').html());
});
</script>
EOL;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM