We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28115
    • 21 Posts

    when i click submit on an empty contact form i should get this

    Some errors were detected in your form:
    The following required field(s) are missing: Your Name, Email Address, Message


    However it says that the blank space is sent..


    Can anyone help me validate this form so that it pulls up error messages, and will send an email to my address
      • 24495
      • 407 Posts
      Your form chunk should be like
      [+validationmessage+]
      <form action="[~[*id*]~]" method="post">
      	<fieldset>
      	<legend>if you need this</legend>
      	<p>
      	<input name="formid" type="hidden" value="formid" />
      	<label for="fieldname">Fieldname</label><br />
      	<input id="fieldname" name="fieldname" type="text" value="" eform="Fieldname missing::1" />
      	</p>
      	<p>
      	and so on
      	</p>
      	</fieldset>
      </form>
      
        • 28115
        • 21 Posts
        The chunk looks like this



        <p class="error">
        [+validationmessage+]
        </p>
        <form action="[~[*id*]~]" id="EmailForm" method="post" name="EmailForm">
        <fieldset>
        <h4>Fill in the form below to email us</h4>
        <input name="formid" type="hidden" value="ContactForm" />
        <font color="#c0c0c0"><label for="cfEmail">Your Email Address:
        <input class="text" id="cfEmail" name="email" type="text" /> </label><label for="cfName">Your name:
        <input class="text" id="cfName" name="name" type="text" /> </label><label for="cfRegarding">Regarding:</label><select id="cfRegarding" name="subject">
        <option value="General Inquiries">
        General Inquiries</option>
        <option value="Press">
        Press or Interview Request</option>
        <option value="Partnering">
        Partnering Opportunities</option>
        </select>
        </font>
        <font color="#c0c0c0"><label for="cfMessage">Message:
        <textarea cols="20" id="cfMessage" name="message" rows="4"></textarea>
        </label><label>&nbsp;</label></font>
        <input class="button" id="cfContact" name="contact" type="submit" value="Send This Message" />
        </fieldset>
        </form>

        huh
          • 24495
          • 407 Posts
          And where is the eform statement for the validation?
          <input id="fieldname" name="fieldname" type="text" value="" eform="Fieldname missing::1" />

          eform="Fieldname missing::1"
            • 28115
            • 21 Posts
            should i be editing two parts or is it this one section that is wrong?

            cant seem to get it working.
              • 24495
              • 407 Posts
              Try this:
              <p class="error">
              [+validationmessage+]
              </p>
              <form action="[~[*id*]~]" id="EmailForm" method="post" name="EmailForm">
                 <fieldset>
                 <h4>Fill in the form below to email us</h4>
                 <input name="formid" type="hidden" value="ContactForm" />
                 <font color="#c0c0c0">
              <label for="cfEmail">Your Email Address:<input class="text" id="cfEmail" name="email" type="text" eform="Email address missing:email:1"  /> </label>
              <label for="cfName">Your name:<input class="text" id="cfName" name="name" type="text" eform="Your name missing::1" /> </label>
              <label for="cfRegarding">Regarding:</label>
              <select id="cfRegarding" name="subject">
                 <option value="General Inquiries"> General Inquiries</option>
                 <option value="Press">Press or Interview Request</option>
                 <option value="Partnering">Partnering Opportunities</option>
                 </select>
                 </font>
                 <font color="#c0c0c0">
              <label for="cfMessage">Message:<textarea cols="20" id="cfMessage" name="message" rows="4" eform="Your message missing::1"></textarea></label>
              </font>
              <input class="button" id="cfContact" name="contact" type="submit" value="Send This Message" />
                 </fieldset>
              </form>
                • 28115
                • 21 Posts
                thank you sir!!!!

                grin