Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2012
    Thanked 0 Times in 0 Posts

    html contact form

    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
    Last edited by mike316; 05-17-2012 at 03:59 AM.

  2. #2
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Thanked 79 Times in 78 Posts
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts