0

Hi please if anyone can help I am very new to HTML and have recently created a website that I have adapted from a template in dreamweaver and there is code already in the HTML for the contact page I have tried and tried and just cannot figure out how to set it into the active. below is what I have so far for the page.

            <section id="contact-text" class="inactive">
                        <div class="col-sm-12 col-md-12">
                            <div class="row">
                                <div class="col-sm-12 col-md-12"><h2>Contact</h2></div>
                                <div class="clearfix"></div>
                            </div>

                            <div class="row">
                                <div class="col-sm-6 col-md-6">
                                    <div id="map-canvas"></div>
                                  <p></p>
                                </div>

                                <div class="col-sm-6 col-md-6">
                                    <form action="#" method="post">

                                            <div class="form-group">
                                                <!--<label for="contact_name">Name:</label>-->
                                                <input type="text" id="contact_name" class="form-control" placeholder="Name" />
                                            </div>
                                            <div class="form-group">
                                                <!--<label for="contact_email">Email:</label>-->
                                                <input type="text" id="contact_email" class="form-control" placeholder="Email Address" />
                                            </div>
                                            <div class="form-group">
                                                <!--<label for="contact_message">Message:</label>-->
                                                <textarea id="contact_message" class="form-control" rows="7" placeholder="Write a message"></textarea>
                                            </div>
                                            <button type="submit" class="btn btn-primary">Send</button>

                                    </form>
CinCout
  • 9,486
  • 12
  • 49
  • 67
  • 1
    This code needs a lot of work, changing the action value, adding a bunch of PHP just to name a few. – Satej S May 11 '16 at 09:39

1 Answers1

0

When you are doing a form, you have to define an action.

<form action="#" method="post">

At this place you are telling your form that his action is to "post" ( send ) informations to a file named "#". First of all, you have to creacte a PHP file like action.php and attribute your previous action to it :

<form action="action.php" method="post">

In this PHP file you want to get your variables and send it by mail.

To do that, i recomment you to read this post and other tips you can find on internet.

Last thing : if you dont want your form to reload the page when the user is submitting it, you have to use AJAX. You can also find documentation about this here

Community
  • 1
  • 1
Relisora
  • 1,163
  • 1
  • 15
  • 33