Fancybox Jquery Form

    Question by:
    On

    Topics:

    Hi

    I have a link to display a user form winthin a fancybox
    a perl script gets the data from a database and populates a simple user form Name Contact info etc

    on hiting update the same script updates the database & displays a Thank You message this works within a a seperate brouser window.
    In the Fancybox window all that happens is the box closes and the parent window refreses and the datbase table remains untouched so i'm unable to tell what is happing because i can't get any message back

    I'm using the example from http://fancybox.net/blog

    Javascript
    
    Attach FancyBox: 
    $("a#UsrFrm").fancybox({
    	'scrolling'		: 'no',
    	'titleShow'		: false,
    	'onClosed'		: function() {
    	    $("#login_error").hide();
    	}
    });
    Simple validation; submit data using Ajax and display response
    $("#login_form").bind("submit", function() {
    
    	if ($("#login_name").val().length < 1 || $("#login_pass").val().length < 1) {
    	    $("#login_error").show();
    	    $.fancybox.resize();
    	    return false;
    	}
    
    	$.fancybox.showActivity();
    
    	$.ajax({
    		type		: "POST",
    		cache	: false,
    		url		: "UsrForm.pl",
    		data		: $(this).serializeArray(),
    		success: function(data) {
    			$.fancybox(data);
    		}
    	});
    
    	return false;
    });
    
                                    
    1:
    2:
    3:
    4:
    5:
    6:
    7:
    8:
    9:
    10:
    11:
    12:
    13:
    14:
    15:
    16:
    17:
    18:
    19:
    20:
    21:
    22:
    23:
    24:
    25:
    26:
    27:
    28:
    29:
    30:
    31:
    32:
    33:
    

    Select allOpen in new window

    Good Question?
    0
     

    ?

    The member who asked this question verified this comment provided the solution that solved their problem.

    Accepted Solution on 2010-05-20 at 00:38:39ID: 32806785

    I managed to fix this by calling the child perl script into an iframe
    The examle works when the pparent document is a html doc it dosn't work when it is a perl script

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201511-LO-Qu-074

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    Julian Hansen

    4

    Articles

    2,653

    Solutions

    Expert in:

    • JavaScript
    • PHP
    • jQuery
    • CSS
    • HTML

    Alexandre Simões

    6

    Articles

    1,016

    Solutions

    Expert in:

    • .NET Programming
    • C#
    • JavaScript
    • Visual Basic.NET
    • ASP.NET

    leakim971

    1

    Articles

    8,116

    Solutions

    Expert in:

    • JavaScript
    • jQuery
    • AJAX
    • ASP.NET
    • HTML

    Mikkel Sandberg

    3

    Articles

    26

    Solutions

    hielo

    8,499

    Solutions

    Expert in:

    • JavaScript
    • PHP
    • ASP
    • HTML
    • jQuery

    Daniel Van Der Werken

    561

    Solutions

    Expert in:

    • C#
    • .NET Programming
    • ASP.NET
    • Programming

    Scott Fell

    1

    Articles

    3,577

    Solutions

    Expert in:

    • ASP
    • HTML
    • Web Development
    • CSS
    • JavaScript

    Sergio Pacheco Jiménez

    1

    Solutions

    zephyr_hex

    2,541

    Solutions

    Expert in:

    • MS SharePoint
    • MS SQL Server 2005
    • Microsoft IIS Web Server
    • Windows 2003 Server
    • Windows XP

    RELATED TOPICS view all topics

    1. JavaScript
      (117,328)
    2. AJAX
      (11,837)
    3. CSS
      (39,377)
    4. HTML
      (56,049)
    5. PHP
      (116,156)
    6. ASP.NET
      (122,084)
    7. Web Development
      (72,042)
    8. JScript
      (6,855)
    9. Web Languages/Standards
      (39,422)
    10. Scripting Languages
      (25,829)