Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
- <link rel="stylesheet" href="scripts/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
- <script type="text/javascript" src="scripts/jquery.fancybox.pack.js?v=2.1.5"></script>
- <script type="text/javascript">
- if(!jQuery.browser.mobile){
- jQuery(document).ready(function() {
- $(".fancybox").fancybox({
- 'width' : 920,
- 'minHeight' : 230,
- 'type' : 'iframe',
- 'padding': 20,
- 'href': 'success.php',
- });
- });
- }
- </script>
- <form action="success.php" method="post" name="contact" id="contact">
- <input type="radio" class="checkbox" name="one" value="yes" title="Do you find yourself using drugs even when you don't want to?: Yes" />
- <label class="question">Do you find yourself using drugs even when you don't want to?</label>
- <input type="submit" name="Submit" id="submit" class="fancybox fancybox.iframe" />
- </form>
- <?php
- if ($_POST['one']=="yes") { echo "Do you find yourself using drugs even when you don't want to?"; }
- ?>
- <form action="success.php" method="post" name="contact" id="contact">
- <input type="radio" class="checkbox" name="one" value="yes" title="Do you find yourself using drugs even when you don't want to?: Yes" />
- <label class="question">Do you find yourself using drugs even when you don't want to?</label>
- <input type="submit" name="Submit" id="submit" class="fancybox fancybox.iframe" /><!-- this is useless here -->
- <a id="check" data-fancybox-type="ajax" href="success.php" id="check">Result</a>
- </form>
- <script type="text/javascript">
- jQuery(document).ready(function() {
- $('#check').on("click", function (e) {
- e.preventDefault(); // avoids calling success.php from the link
- $.ajax({
- type: "POST",
- cache: false,
- url: this.href, // success.php
- data: $("#contact").serializeArray(), // all form fields
- success: function (data) {
- // on success, post returned data in fancybox
- $.fancybox(data, {
- // fancybox API options
- fitToView: false,
- openEffect: 'none',
- closeEffect: 'none'
- }); // fancybox
- } // success
- }); // ajax
- }); // on
- }); //ready
- </script>
- $(document).ready(function(){
- $("#"+secc+"form").submit(function(){
- var formData = new FormData($(this)[0]);
- $.ajax({
- url: '../form/',
- type: 'POST',
- data: formData,
- async: false,
- success: function (data) {
- //history,go(-1);
- },
- cache: false,
- contentType: false,
- processData: false
- });
- return false;
- });
- });
- jQuery(document).ready(function() {
- $(".fancybox").fancybox({
- 'width' : 920,
- 'minHeight' : 230,
- 'type' : 'iframe',
- 'padding': 20,
- 'href': 'success.php',
- 'data': $("#contact").serializeArray(),//send all form fields
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement