View Full Version : html contact form

05-17-2012, 03:56 AM
hi guys
I have downloaded this template and I am almost done but I ran into a problem with the contact form.

the only kind of contact form i have seen is when you do <form action="script.php">
but this template has this weird thing, I dont understand how it works. Here is a picture:
how does the script send emails when the form has no action?

I am just wondering would I break anything if I change this to:

In other words, put form action at the top, and get rid of the getelementsbyid at the bottom?
I believe there is some javascript interactions here...will my website get messed up if i do the above change? will it maybe not work in some browsers or something?

if you need more information about the template, such as the style.css, reset.css, or the javascript files, the entire template can be downloaded from here: http://www.sendspace.com/file/agsytv

05-17-2012, 02:07 PM
You are correct that you'll need the action attribute to process the form. You'll also need the method attribute eg method="post".

The two anchors you removed were using a javascript method to process the form. I too would have done what you've done, as you won't depend on javascript being turned on.

I haven't looked at the attached files, but if there's CSS attached to this form, then you're going to need to re-add class="button1" to the submit button. Also, as it is now a button you'll need to add a couple of extra lines to get rid of the default button style.

background: transparent;
border: none;

Note you also missed the value attribute from the submit button.