treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Contact Form Help :]

  • welcome.

    "SuperPaperSam" said:
    I really like the look of the Nice Simple Contact Form (Demo) But I like the features of the Contact Form (Demo)

    So I edited the pictures in the Contact Form to look like thoughts in the Nice Simple Contact Form

    That's when I bumped into my problem. (read the code for a description)

    change the background images to look like you want it to. then whichever contact form you like copy it exactly, but change the image & the post part of the HTML form, to your directory you will be using.

    I added to the code below from your comments


    // CHANGE THE VARIABLES BELOW

    $EmailFrom = \"junk@junk.com\"; // What do I do with this? I would get the persons email here e.g.$Email = Trim(stripslashes($_POST['Email']));
    $EmailTo = \"junk@junk.com\"; // Is this the E-mail that the info will be sent to? yes
    $Subject = \"Mydomain -- Contact\"; // I know what this is :)

    $Name = Trim(stripslashes($_POST['Name'])); // No Idea - getting the name from the HTML form variable called Name
    $Tel = Trim(stripslashes($_POST['Tel'])); // Still no idea - same idea as above
    $Email = Trim(stripslashes($_POST['Email'])); // You guessed it no idea - you guessed it same idea as above
    $Message = Trim(stripslashes($_POST['Message'])); // Dont know what to put :( - you don't need to , the person filling in the form will do that, all your doing is collecting the content of each part above
    //the Trim(stripslashes($_POST['Name'])); is cleaning what was put in the field named Name and assigining it to a variable called $Name - which you can use later on.


    But I also what the form to all be in a single row. Now It has the "Name" and "Email" on the left and the "message" on the right. How would I fix this?
    eh??? explain further, please treat me like a 5 yr old when your explaining.
    what I think is nameGDN____ emailGDN_____ telGDN_____ (one very very long contact form, which I would never fill in.


    Bellow I have all the code you should need.

    Code in index...

    $(document).ready(function(){

    $(\"#formLeft .input-bg\").hover(function() {
    $(this).addClass(\"active\");
    }, function() {
    $(this).removeClass(\"active\");
    });

    $(\"#formLeft input\").focus(function() {
    $(this).parent().addClass(\"active\");
    });
    $(\"#formLeft input\").blur(function() {
    $(\"#formLeft .input-bg\").removeClass(\"active\");
    });

    $(\"#formRight .message-bg\").hover(function() {
    $(this).addClass(\"active\");
    }, function() {
    $(this).removeClass(\"active\");
    });

    $(\"#formRight textarea\").focus(function() {
    $(this).parent().addClass(\"active\");
    });
    $(\"#formRight textarea\").blur(function() {
    $(\"#formRight .message-bg\").removeClass(\"active\");
    });

    $(\"#commentForm\").validate();
    });


    Code in CSS...

    * { margin: 0; padding: 0; }
    body { font-size: 62.5%; font-family: Georgia, serif; background: url(images/page-bg.jpg); }
    .clear { clear: both; }
    fieldset { border: none; }
    input, textarea, a { outline: none; }

    #page-wrap {
    width: 800px;
    margin: 0 auto;
    background: url(images/form-bg.jpg) top center no-repeat;
    min-height: 600px;
    }
    form {
    padding: 83px 0 0 76px;
    }
    h1 {
    text-align: center;
    padding-top: 200px;
    }
    #formLeft {
    width: 320px;
    float: left;
    }
    #formLeft input {
    width: 250px;
    margin: 0 0 20px 0;
    border: none;
    text-align: center;
    background: none;
    margin: 13px 0 0 8px;
    font-size: 1.4em;
    }
    #formLeft .input-bg {
    background: url(images/form-sm-bg.jpg) bottom left no-repeat transparent;
    height: 45px;
    margin-bottom: 10px;
    position: relative;
    }
    #formLeft .active {
    background: url(images/form-sm-bg.jpg) top left no-repeat transparent;
    }
    #formRight {
    width: 360px;
    float: right;
    padding-right: 44px;
    }
    #formRight textarea {
    width: 298px;
    height: 209px;
    display: block;
    border: none;
    background: none;
    margin: 0 0 0 20px;
    padding: 13px 0 13px 0;
    font-family: Helvetica, sans-serif;
    font-size: 1.3em;
    overflow: auto;
    }
    #formRight .message-bg {
    background: url(images/message-bg.jpg) bottom left no-repeat transparent;
    height: 238px;
    }
    #formRight .active {
    background: url(images/message-bg.jpg) top left no-repeat transparent;
    }



    Sorry about all the code but I'm not to great with PHP

    Any help would be GREAT!