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

     

    Verified Answer?

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

    by:Posted 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

    This content is available to Experts Exchange members

    See the answer now
    with your Free 30 Day Trial

    Get unlimited access to solutions & experts

    • 4,169,477 solved questions
    • 3,805 articles & videos
    • 15,413 tech experts

    Get Access Now

    Ask Your Tech Question. Get Expert Solutions.We will email you when an expert has commented on your question.

    We will never share this with anyone. Privacy Policy Terms of Use

    Select topics

    You may select up to five topics.

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201507-LO-Qu-065

    EXPERT WHO ANSWERED

    trevor1940

    trevor1940 has answered 8 questions on Experts Exchange and is an expert in MS SharePoint, Web Servers and CSS.

    RELATED TOPICS view all topics

    1. JavaScript
      (116,299)
    2. AJAX
      (11,656)
    3. CSS
      (38,786)
    4. HTML
      (55,266)
    5. PHP
      (115,307)
    6. ASP.NET
      (121,164)
    7. Web Development
      (70,772)
    8. JScript
      (6,821)
    9. Web Languages/Standards
      (39,264)
    10. Scripting Languages
      (25,472)