[RESOLVED] Need help tying JS to HTML forms for my biz website. Files included. Please help.
I don't quite know where I went wrong, but it doesn't seem to be referenced properly or something, because neither of the forms validate or send anything to my email. I'm kind of at a loss at this point..
Please, if anybody could help me, I would immensely appreciate it.
Thank you so much. <3
heh, Wow! When I downloaded the code I didn't really expect the entire website
If you have the site live somewhere, or if you could point out in what files things are supposed to be happening, then it would make debugging the problem a lot easier.
Right now I feel like I'm looking for a needle.
clinic4pc.com, go to the service tab and click on a form link, the forms show up but they don't have any field validation for submission, and also the php to send the form data to my email doesn't seem to be working along with it.
Sorry about the whole package by the way, but I thought it might help if someone's looking to see where I messed up.
Thanks so much for your help, by the way!!
You will see the specific forms in the "HTML forms" folder. The JS and PHP folders also hold files referenced in the HTML forms.
Ok, a few things up front before we can start debugging properly:
standard_service_form.html : Line 10
standard_service_form.html : Line 11
standard_service_form.html : Line 522
<form method="post" action="contact.php" onsubmit="return CheckForm();">
(you can put the thank you message in the script file instead)
<input type="submit" value="Submit Form" />
Remember, depending on your host, case-sensitivity is also important so watch how you name files/folders. I typically just keep everything lowercase to avoid problems.
Once we have those corrections done at least then we can look at how the validation script works
Wow, I just realised your <form> is sitting in the <head>, it should be moved inside the <body> tag. And the <form> is being closed prematurely after the Personal Info section, that should be removed.
Last edited by bionoid; 11-29-2013 at 01:53 AM.
Aha, I'm sorry about that. I let my boyfriend fiddle around with my forms a bit tonight, and hadn't actually done any reviewing before zipping it all up. He wrote the JS and PHP for me. Thank you very much for your help though, and thank you for letting me know about that little oopsie, I will get on to fixing that all up right away. I will mention you in my code as requested if all works properly, and let you know how it goes on here before I call this as resolved.
lol, if I'm not mistaken, I believe you have misunderstood what I meant. When I said you can put the thank you message into your script file I was referring to your original submit button message:
Originally Posted by BunnyFett
I don't need recognition, I help out because I enjoy it I hope you come right though, good luck. And don't let your boyfriend touch your code again, heehee.
<button type="submit" onClick="alert('Thank you for filling out our order form. Your submission has been forwarded to our email and will be read and addressed within the same service day.')">Submit Form</button>
Ah, alrighty then. I already did that before reading this, but I figured you meant just an occlusion section because people can go through website scripts and whatnot.
Anyhow it seems to partially work, but it's still broken. There's still no validation happening, and the php seems to be a bit buggy.
Thank you anyhow for the proper html formatting, I think that part is out of the way now.
I will have to go over my scripts more later today I guess.
Would you know anything about php and js by chance? Shot in the dark, but still a worthy shot, aha. ^^;
All of my issues are relative to the folders I've uploaded. I put the forms up on the website again, and the first thing I get upon submission is "Parse error: syntax error, unexpected T_VARIABLE in /home/clinic4p/public_html/php/contact.php on line 4". There is no validation happening as well. I appreciate your help with all of this, but if this does get to be too much work for you then I will understand if you have to stop.
I kind of suck with most web development stuff that isn't html and css, honestly.. so any help I can get with the rest would be just wonderful.
If you have Skype, we could type on there for faster replies, but if not then that is also fine. You seem to know what you're doing and I appreciate your help very much either way.
Sure... I will make the request if that's ok with you. I don't want to publish my Skype details on the forum :P
Sounds fine to me. You have much more appearance on this site than I do, lol.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread