Question

Fancybox Jquery Form

Asked by: trevor1940
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

This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Sign Up Now!
Asked On
2010-05-14 at 03:18:33ID: 26185548
Topics

Jquery

,

Asynchronous Javascript and XML (AJAX)

Participating Experts
1
Points
0
Comments
4

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

Companies like CAT, Honeywell, Chevron, Toyoto, TriStar Pictures, the U.S. Army, and Accenture

Your Complete Technology Resource

900+ topic areas (and counting)

Related Solutions

  1. Populate subform with data from parent form
    Experts, I have an access 2000 db in which I have created a form. that form in turn has a subform. The parent form has a field called sTally. The child form also has a field called sTally. Likewise, I have a field called, sQty, in whic...
  2. How to refresh parent window on clicking close …
    I'm using jquery colorbox in an admin suite to have a neat little separate window to upload an image in (a bit like facebook profile pic upload I suppose). What i'd like to do is click close after uploading the photo and for the parent ...
  3. jquery, parent() explanation
    Hello experts, I am trying to find out who is the parent of "ul li.next-button" for my jquery function to display the "hola" message. Below you will see snippets of the code. What I am doing wrong? thanks Winter...
  4. Submit a form onclick with Jquery autocomplete
    I'm using jquery autocomplete on a search form. I would like the form to submit when a result is clicked. IE: No submit button. Current code is below. Thanks in advance.
  5. Editing Jquery & Ajax database populated select…
    Hello All, I'm using Jquery & Ajax database populated select form. While adding the data, I have no problem. Since I have to choose menu's from beginning. My problem is while trying to edit them. For example, I'm trying to add new...
  6. duplicate form element with jquery
    Hi I need to duplicate a form element dynamically for a student registration. I am completely new at using jquery so while I did find tutorials I am a bit overwhelmed. Attached is an image of the form element and here is the code bit ...
Tutorials are great ways to tackle hard problems!

Featured Articles

Read through articles written by top experts!

Get full access to the help you need.

Subscribe Now

30-day free trial. Register in 60 seconds.

The Latest Technology News and Tips

Your answer is only minutes away!

New Solutions Everyday

Because of our active community of experts, on average new questions receive their first comment in under 30 minutes.

Top Jquery Questions

       

Hear What our Users are Saying

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

20130221-EE-VQP-038

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Development.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Microsoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...an excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans