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 12-19-2012, 12:03 AM   PM User | #1
Cyrusis
New Coder

 
Join Date: Dec 2012
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Cyrusis is an unknown quantity at this point
Need a little help with a jquery form success function.

Hi there!

I have an issue with the form I incorporated into my website. It sends the email to me in the end with the right information but there seems to be an issue when it's finished sending. It is supposed to close and submit a message saying Thank you but instead it drags down or just closes without saying anything. To clarify, the box animates and closes upwards without reloading the page and displays a Thank you, We will contact you soon ! in the grey bar that remains.


Here's the code in the html:
Code:
		<script>
		$(document).ready(function() {
			
			
			
			// SUCCESS AJAX CALL, replace "success: false," by:     success : function() { callSuccessFunction() }, 
			$("#form1").validationEngine({
				ajaxSubmit: true,
					ajaxSubmitFile: "ajaxSubmit.php",
					ajaxSubmitMessage: "Thank you, We will contact you soon !",
				success : function() { callSuccessFunction() },
				failure : function() {}
			})
			

		
		});
		</script>
I tried to do this, as per Old_Pedant's suggestion:
Code:
     success : function() { alert("email sent successfully"; },
     failure : function() { alert("unable to send email"; }
But it didn't work.

Please if someone could help me button this up, it would be fantastic and I'll be able to finish this little project of mine. Greatly appreciate it! If any more details are needed please let me know.

Last edited by Cyrusis; 12-19-2012 at 10:37 PM..
Cyrusis is offline   Reply With Quote
Old 12-19-2012, 03:35 AM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
should be

Code:
    success : function() { alert("email sent successfully"); },
     failure : function() { alert("unable to send email"); }
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Users who have thanked DanInMa for this post:
Cyrusis (12-19-2012)
Old 12-19-2012, 05:29 AM   PM User | #3
Cyrusis
New Coder

 
Join Date: Dec 2012
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Cyrusis is an unknown quantity at this point
Excellent that seemed to work. I updated the site for you to see. It works but I don't really like old school prompt box that pops up? It seems to have worked nicely on the page once submitting.

Any suggestions to keeping it working and removing the box prompt? Thank you!
Cyrusis is offline   Reply With Quote
Old 12-19-2012, 02:46 PM   PM User | #4
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
you could make your own modal, use jquery ui's dialog/modal (http://jqueryui.com/dialog/#modal-message), you are only limited by your imagination.

you can also add a hidden div and use .show and .hide to show and hide it and .html() to change the contents of the div so you can use the same div for any of your form feedback
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Users who have thanked DanInMa for this post:
Cyrusis (12-19-2012)
Old 12-19-2012, 07:30 PM   PM User | #5
Cyrusis
New Coder

 
Join Date: Dec 2012
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Cyrusis is an unknown quantity at this point
Hey Dan, is there any way you can show me an example of this? I'm not very familiar with much outside of HTML and CSS.

I should probably take the time to learn but I honestly don't have the time.

Thank you so much.
Cyrusis is offline   Reply With Quote
Old 12-21-2012, 04:17 AM   PM User | #6
Cyrusis
New Coder

 
Join Date: Dec 2012
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Cyrusis is an unknown quantity at this point
Can someone please elaborate on this?

I don't know how to incorporate the hidden Div to the above modified code and the jquery link shows how to adjust the style of the box that prompts but not remove it?


Thank you!
Cyrusis 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:14 AM.


Advertisement
Log in to turn off these ads.