Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
help with contact form
Old 03-30-2010, 01:13 AM help with contact form
ZoC
Skilled Talker

Posts: 68
Trades: 0
hello there,

this is my code and i dont know why is not working ... hope someone can tell me what is the problem ...

HTML Code:
  <script type="text/javascript">
   function checkForm() {
    name = document.getElementById("name").value;
    email = document.getElementById("email").value;

    if (name == "") {
     hideAllErrors();
      document.getElementById("nameError").style.display = "inline";
      document.getElementById("name").select();
      document.getElementById("name").focus();
     return false;
    } else if (email == "") {
     hideAllErrors();
      document.getElementById("emailError").style.display = "inline";
      document.getElementById("email").select();
      document.getElementById("email").focus();
     return false;
    }
    return true;
   }
   function hideAllErrors() {
    document.getElementById("nameError").style.display = "none"
    document.getElementById("emailError").style.display = "none"
   }
  </script>

<form onsubmit="return checkForm();" method="post" action="contact.php" class="form_contact">

<div class="left">Full Name:</div>
<div class="right"><input type="text" name="name" id="name" size="20" /></div>
<div style="clear: both;"></div>

<div class="left">Email:</div>
<div class="right"><input type="text" name="email" id="email" /></div>
<div style="clear: both;"></div>

<div class="ordernow_p">
  <input type="hidden" name="sendmail" id="sendmail" value="sendmail" /><div class="process_order"><a href="javascript:document.submit.submit();"></a></div>
</div>

</form>
when i click on the submit photo is not working ... but if i change the input submit code

HTML Code:
<input class="contact_form3" class="buttons"  name="sendmail" id="sendmail" type="submit" value="Send Msg !" />
is working ... can someone help me with this command ...

i think this is the problem ...

HTML Code:
<input type="hidden" name="sendmail" id="sendmail" value="sendmail" /><div class="process_order"><a href="javascript:document.submit.submit();"></a></div>
ZoC is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-31-2010, 07:00 AM Re: help with contact form
Super Talker

Posts: 139
Name: John Davis
Trades: 0
your submit button must be within <form></form> tags.
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Old 04-06-2010, 02:57 PM Re: help with contact form
Novice Talker

Posts: 11
Name: Robby
Location: Indianapolis
Trades: 0
Quote:
Originally Posted by MapMaster View Post
your submit button must be within <form></form> tags.
Ya, that should do it
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
indyonline is offline
Reply With Quote
View Public Profile Visit indyonline's homepage!
 
Reply     « Reply to help with contact form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11393 seconds with 12 queries