#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Form submit button not working


    hi can someone help with this problem.

    my submit button will not do anything

    my code for the form is:

    Code:
    <div id="contact_form"
    	<form name="contact" action="send_mail.php" method="post">
    		Name: <input style="width:180px;"type="text" name="name"></input><br><br>
    		Telephone: <input style="width:180px;"type="text" name="telephone"></input><br><br>
    		E-mail: <input style="width:180px;"type="text" name="email_address"></input><br><br>
    		<label style="vertical-align: top;">Message:</label>
    		<textarea style="width:179px" type="text" name="message" rows="8"></textarea><br><br>
    		<input id="submit" type="submit" value="Send Message"></input>
    	</form>
    </div>
    i tested the form code in a seperate page to the one i want it in and it does work, could it be my css or sumthing like that stopping it?

    Thanks in advance
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    17
    Rep Power
    0
    There were a few issues. One tags like <input> are self closing. Meaning they don't need a closing tag like </input>. You just close it with a "/". Same thing with your <br /> tags you needed the "/".

    Heres what your code should look like. I haven't tested it but it should work.

    Code:
    <div id="contact_form">
     <form name="contact" action="send_mail.php" method="post">
      Name: <input style="width:180px;"type="text" name="name" />
      <br />
      <br /> 
      Telephone: <input style="width:180px;"type="text" name="telephone" />
      <br />
      <br /> 
      E-mail: <input style="width:180px;"type="text" name="email_address" />
      <br />
      <br /> 
      <label style="vertical-align: top;">Message:</label>
      <textarea style="width:179px" type="text" name="message" rows="8"></textarea>
      <br />
      <br /> 
      <input id="submit" type="submit" value="Send Message" />
     </form> 
    </div>
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0
    Thanks that did work, cant believe it was something so simple
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0
    <input id="submit" type="submit" value="Send Message"></input>

    should write like this

    <input id="submit" type="submit" value="Send Message" />
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0
    Originally Posted by Orfantal
    hi can someone help with this problem.

    my submit button will not do anything

    my code for the form is:

    Code:
    <div id="contact_form"
    	<form name="contact" action="send_mail.php" method="post">
    		Name: <input style="width:180px;"type="text" name="name"></input><br><br>
    		Telephone: <input style="width:180px;"type="text" name="telephone"></input><br><br>
    		E-mail: <input style="width:180px;"type="text" name="email_address"></input><br><br>
    		<label style="vertical-align: top;">Message:</label>
    		<textarea style="width:179px" type="text" name="message" rows="8"></textarea><br><br>
    		<input id="submit" type="submit" value="Send Message"></input>
    	</form>
    </div>
    i tested the form code in a seperate page to the one i want it in and it does work, could it be my css or sumthing like that stopping it?

    Thanks in advance

    Hi, I see you are missing the closing ">" in the <div> tag.
    <div id="contact_form" .... use <div id="contact_form">

IMN logo majestic logo threadwatch logo seochat tools logo