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 02-23-2009, 02:06 PM   PM User | #1
eric float
New Coder

 
Join Date: Dec 2007
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
eric float is an unknown quantity at this point
reset form()

hi ! i have captcha form in my form . when send data with submit change captcha auto and reset form . ( with out jquery ) now : with jquery send data worked but not reset form after send data . how to reset form with jquery or reset any field ( captcha field ) after submit ?
Code:
$(document).ready(function() {
 
	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});
 
	$('#myForm').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
})
eric float is offline   Reply With Quote
Old 02-24-2009, 06:26 PM   PM User | #2
harbingerOTV
Senior Coder

 
Join Date: Jan 2005
Location: Memphis, TN
Posts: 1,765
Thanks: 8
Thanked 123 Times in 121 Posts
harbingerOTV will become famous soon enough
take a look at that
http://www.learningjquery.com/2007/0...ring-form-data

PHP Code:
    $('#myForm').submit(function() {
        $.
ajax({
            
type'POST',
            
url: $(this).attr('action'),
            
data: $(this).serialize(),
            
success: function(data) {
                $(
'#result').html(data);
            }
        })
              $(
this).clearForm()
        return 
false;
    }); 
that might work. havent tested it though
__________________
Stop making things so hard on yourself.
i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis
harbingerOTV 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 01:42 PM.


Advertisement
Log in to turn off these ads.