Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-24-2009, 11:29 AM   PM User | #1
capnhud
New to the CF scene

 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
capnhud is an unknown quantity at this point
Animate Message with jQuery Form Plugin

I am having a problem using the jquery Form Plugin. I have a form that is setup that I would like to animate the errors/success when a user submits incorrect information or gives the user a succes message when then enter correct information.

I would like the different messages to slide into view when being displayed but right now they just pop into view. How do I make it animate or rather slide into view? The page is question is http://capnhud.host22.com/sampleform2.html

The code I am using is:
Code:
$(function() { 
    // bind form using ajaxForm 
    $('#myForm').ajaxForm({ 
        // target identifies the element(s) to update with the server response 
        target: '.message', 
 
        // success identifies the function to invoke when the server response 
        // has been received; here we apply a fade-in effect to the new content 
        success: function() { 
            $('.message').slideDown('slow'); 
        } 
				error: function() {
						$('.message').slideDown('slow');
				}
		}); 
});

$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};

But no matter what this does not slideinto view it just pops
capnhud is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:22 PM.


Advertisement
Log in to turn off these ads.