![]() |
Contact Form Doesn't Work
Hey guys,
I would greatly appreciate if someone can take a quick look and tell me where is my mistake with the form embedded in the index.html file (almost sure it's related to the 'action=' part) Im trying to use the js/form-top.js to parse the form data and use the bin/form-top.php to post it. I must do something wrong. The relevant code section is: form-top.ashx PHP Code:
PHP Code:
form-top.js Code:
$(function(){index.html Code:
<form id="form-top" action="#" method="post" enctype="multipart/form-data"> |
I don't know if you took the file out of your action on purpose or not. But your form doesn't have an action at all. It simple says
Code:
action="#"You can declare what php file to use as the action in your JavaScript. Which in your case should be helpful. Take a look at this tutorial. http://www.askaboutphp.com/213/php-a...-the-page.html Maybe you can take some ideas from this, and apply it to your code. Looking through your script it shouldn't be too hard. If it were me I would write most of the validation stuff you've got in form-top.js as PHP, and use JavaScript only for submitting the form. But that's just me. A nice Ajax contact form tutorial is over at http://tutorialzine.com/2009/09/fancy-contact-form/ They;ve gone in a little bit different of a direction than you, but it's a pretty nice script. |
| All times are GMT +1. The time now is 08:51 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.