Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2012
    Location
    Under a Roof
    Posts
    14
    Thanks
    2
    Thanked 1 Time in 1 Post

    Question Required fields not working

    I have created a contact us form that should redirect back to itself if the required fields are not met, and redirect to a thank you page when required fieldes are met.

    However the reqired fields when not met, IE: all blank fields redirect to the thank you page and I receive the blank emal with the header "Thank you For Submitting you query"

    I am also getting a lot of "<SPAN class=formSpan>" highlighted in yellow in Dreamweaver CS6 trial version, could these be causing the issue.

    As a noob i dont know how to fix this and would be grateful for your help.

    Note email and phone number has been changed

    Code:
    <HTML>
    
    <HEAD>
    
    <STYLE>
    
    BODY, TD, P {
    
    	font-size: 12pt;
    
    	font-family: times new roman, times, serif;
    
    }
    
    H1 {
    
    	font-size: 26pt;
    
    	font-family: arial, helvetica, sans-serif;
    
    	font-weight: normal
    
    }
    
    H2 {
    
    	font-size: 18pt;
    
    	font-family: arial, helvetica, sans-serif;
    
    	font-weight: normal
    
    }
    
    H3 {
    
    	font-size: 16pt;
    
    	font-weight: normal
    
    }
    
    H4 {
    
    	font-size: 14pt;
    
    	font-weight: normal
    
    }
    
    A {
    
    	text-decoration: none
    
    }
    
    A:hover {
    
    	text-decoration: underline
    
    }
    
    </STYLE>
    
    </HEAD>
    
    <BODY><SPAN class=formSpan>
    
    <DIV align=justify><BR></DIV>
    
    <FORM method=post action=http://www.torfaenpcrepair.com/cgi-bin/FormMail.pl>
    
    <P><IMG align=right src="/contact-page-title1.jpg" width=200 height=200></P>
    
    <P align=justify>We look forward to hearing from you 
    
    <DIV align=justify>Please fill out the form below and click "Submit." We will get back to you as soon as possible</DIV>
    
    <DIV align=justify>please note that fiels marked with * are required fields so that we can process your query more efficiently! <BR></DIV>
    
    <DIV align=justify>Alternatively you can Email us at <A href="mailto:correct@mail.com">correct@mail.com</A></DIV>
    
    <DIV align=justify>Or<BR></DIV>
    
    <DIV align=justify>Telephone us on 01234 546789 Mobile 02345678909</DIV></SPAN><SPAN class=formSpan><LABEL style="DISPLAY: block" for="02 - Name ">*Name </LABEL>
    
    <P><INPUT name=realname> </P>
    
    <P></SPAN><SPAN class=formSpan>&nbsp;</P><LABEL style="DISPLAY: block" for="03 - Email Address "></LABEL><LABEL style="DISPLAY: block" for="03 - Email Address ">*Email Address </LABEL><LABEL style="DISPLAY: block" for="03 - Email Address "><INPUT id="03 - Email Address " class=fw-textarea name="03 - Email Address " size=30 type=input> </SPAN></LABEL><SPAN class=formSpan><LABEL style="DISPLAY: block" for="04 - Phone Number (optional) "></LABEL><LABEL style="DISPLAY: block" for="04 - Phone Number (optional) "></LABEL><LABEL style="DISPLAY: block" for="04 - Phone Number (optional) ">Phone Number (optional) </LABEL><LABEL style="DISPLAY: block" for="04 - Phone Number (optional) "></LABEL>
    
    <P align=justify><INPUT id="04 - Phone Number (optional) " class=fw-textarea name="04 - Phone Number (optional) " size=30 type=input> </P></SPAN><SPAN class=formSpan><LABEL style="DISPLAY: block" for="05 - Web Browser"></LABEL><LABEL style="DISPLAY: block" for="05 - Web Browser">*Web Browser<BR><SELECT> <OPTION selected value="  "></OPTION> <OPTION value="IE 7">IE 7</OPTION> <OPTION value="IE 8">IE 8</OPTION> <OPTION value="IE 9">IE 9</OPTION> <OPTION value=Chrome>Google Chrome</OPTION> <OPTION value=Firefox>Firefox</OPTION> <OPTION value=Other>Other</OPTION></SELECT> <BR>
    
    <P></P><SPAN class=formSpan><LABEL style="DISPLAY: block" for="06 - Select Operating System"></LABEL><LABEL style="DISPLAY: block" for="06 - Select Operating System">*Operating System<BR><SELECT name="Operating System"> <OPTION selected value="  "></OPTION> <OPTION value=XP>XP</OPTION> <OPTION value=Vista>Vista</OPTION> <OPTION value="Win 7">Win 7</OPTION> <OPTION value="Win 8">Win 8</OPTION> <OPTION value=Other>Other</OPTION></SELECT><BR></SPAN>&nbsp;
    
    <P></P><SPAN class=formSpan><LABEL style="DISPLAY: block" for="08 - Have you got a Firewall Installed"></LABEL><LABEL style="DISPLAY: block" for="08 - Have you got a Firewall Installed">*Have you got a Firewall Installed</LABEL> <LABEL style="DISPLAY: block" for="08 - Have you got a Firewall Installed"></LABEL>
    
    <P align=justify><INPUT id="08 - Have you got a Firewall Installed" class=fw-textarea name="08 - Have you got a Firewall Installed" type=input> </SPAN></P><SPAN class=formSpan><LABEL style="DISPLAY: block" for="09 - Have you got AntiVirus Installed"></LABEL><LABEL style="DISPLAY: block" for="09 - Have you got AntiVirus Installed">*Have you got AntiVirus Installed</LABEL> 
    
    <P align=justify><INPUT id="09 - Have you got AntiVirus Installed" class=fw-textarea name="09 - Have you got AntiVirus Installed" type=input> </SPAN></P>
    
    <P class=formSpan align=justify>*Please state the type of support you need. Please tick all that apply</P><SPAN class=formSpan>
    
    <P align=justify><BR><INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Email support" type=checkbox> Email support <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="General advice" type=checkbox> General advice <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Remote support" type=checkbox> Remote support <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Report a problem with the site" type=checkbox> Report a problem with the site</P>
    
    <P align=justify><INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Software problems" type=checkbox> Software problems <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Hardware problems" type=checkbox> Hardware problems <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Data backup" type=checkbox> Data backup <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Data recovery" type=checkbox> Data recovery</P>
    
    <P align=justify><INPUT name="10 - Please state the type of support you need. Please tick all that apply" value=Laptop type=checkbox> Laptop <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Desktop Tower" type=checkbox> Desktop Tower <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Desktop midi" type=checkbox> Desktop midi <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value=Other type=checkbox> Other <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Virus-Spyware removal" type=checkbox> Virus-Spyware removal</P>
    
    <P align=justify><INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Internet problems" type=checkbox> Internet problems <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Wireless conectivity" type=checkbox> Wireless conectivity <INPUT name="10 - Please state the type of support you need. Please tick all that apply" value="Home visit" type=checkbox> Home visit</P></SPAN>
    
    <P align=justify><SPAN class=formSpan><TEXTAREA cols=70 rows=15 name=*Message></TEXTAREA> </P></FORM><INPUT dir=ltr lang=en onclick=Submit name=Submit value=Submit type=submit> <INPUT name=recipient value=correctemailcom type=hidden> <INPUT name=subject value="Thank you For Submitting you query " type=hidden> <INPUT name=redirect value=http://torfaenpcrepair.com/ThankYou.html?_cache=1348966966 type=hidden> <INPUT name=missing_fields_redirect value=http://torfaenpcrepair.com/contact%20Us.html?_cache=1348967037 type=hidden> <INPUT name=required type=hidden> </FORM>
    
    <DIV class=fw-paragraphbottom align=justify></DIV></SPAN></LABEL></LABEL></SPAN></BODY
    Last edited by TPCR; 10-01-2012 at 06:36 PM. Reason: Added extra information

  • #2
    New Coder
    Join Date
    May 2012
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts
    your way of coding is very very much wrong.there are many mistakes in this code.i am just telling you few ones
    >>try to avoid capital letters in coding

    >>close all the tags(you haven't ended <body> and <html>)

    >> WRITE align="center" i.e. with quotes. you no where have written properties in quotes like in class="abc" and name="xyz" and many more ones. Also method="POST" and action="xyz.com" and many more

  • #3
    New Coder
    Join Date
    Oct 2012
    Location
    Under a Roof
    Posts
    14
    Thanks
    2
    Thanked 1 Time in 1 Post
    Hi

    Thank you for your quick replys

    I have amended some of the code on your advice and here is where I am at with 1 yellow flag in line 58 if I alter it in any way it stops the submit button working.

    Example CS6 says it is an invalid markup as overlapping or unclosed tag, Reapply the style and then delete these tags,

    If I reaplpy the style to </span> it changes to </span><span class="&lt;/span&gt;"><span class="formSpan"></span><span> and the form still works however upon on deleting these tags the form stops working.


    As a noob I am expecting it is not 100% right and if you could point me in the right direction I will be very grateful.

    I have just finished sorting the errors the best I can and still have to associate the required fields but getting there (I Hope)

    Refering to the required fields, would it be different for the checkboxes as I require clients to be able to input any number of fields but still prefer it to be a reqired protocol


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <style>
    body, td, p {
    font-size: 12pt;
    font-family: times new roman, times, serif;
    }
    h1 {
    font-size: 26pt;
    font-family: arial, helvetica, sans-serif;
    font-weight: normal
    }
    h2 {
    font-size: 18pt;
    font-family: arial, helvetica, sans-serif;
    font-weight: normal
    }
    h3 {
    font-size: 16pt;
    font-weight: normal
    }
    h4 {
    font-size: 14pt;
    font-weight: normal
    }
    a {
    text-decoration: none
    }
    a:hover {
    text-decoration: underline
    }
    </style>
    </head>
    <body></p>
    <span class="formSpan"></span>
    <div align="justify"><br />
    </div>
    <form method="post" action="http://www.torfaenpcrepair.com/cgi-bin/FormMail.pl">
    <p><img align="right" src="/contact-page-title1.jpg" width="200" height="200" /></p>
    <p align="justify">We look forward to hearing from you </p>
    <div align="justify">Please fill out the form below and click &quot;Submit.&quot; We will get back to you as soon as possible</div>
    <div align="justify">please note that fiels marked with * are required fields so that we can process your query more efficiently! <br />
    </div>
    <div align="justify">Alternatively you can Email us at <a href="mailto:correct@email.com">correct@email.com</a></div>
    <div align="justify">Or<br />
    </div>
    <div align="justify">Telephone us on 01234 567890 <br> Mobile 01234567890</div>
    </form></p>
    <span class="formSpan"></span>
    <label style="DISPLAY: block" for="02 - Name ">*Name </label><input name="realname" /> </p>
    <label style="DISPLAY: block" for="03 - Email Address "></label>
    <label style="DISPLAY: block" for="03 - Email Address ">*Email Address</label>
    <label style="DISPLAY: block" for="03 - Email Address ">
    <input id="03 - Email Address " class="fw-textarea" name="03 - Email Address " size="30" type="input" />
    </label></label></label></p>
    <p>
    <span class="formSpan"></span>
    <label style="DISPLAY: block" for="04 - Phone Number (optional) "></label>
    <label style="DISPLAY: block" for="04 - Phone Number (optional) ">Phone Number (optional) </label><label style="DISPLAY: block" for="04 - Phone Number (optional) "></label><input id="04 - Phone Number (optional) " class="fw-textarea" name="04 - Phone Number (optional) " size="30" type="input" /></label></label></label></p>
    <p><span class="formSpan">
    <label style="DISPLAY: block" for="05 - Web Browser"></label>
    <LABEL style="DISPLAY: block" for="05 - Web Browser">
    *Web Browser</LABEL>
    <select>
    <option selected="selected" value=" "></option>
    <option value="IE 7">IE 7</option>
    <option value="IE 8">IE 8</option>
    <option value="IE 9">IE 9</option>
    <option value="Chrome">Google Chrome</option>
    <option value="Firefox">Firefox</option>
    <option value="Other">Other</option>
    </select>
    <br />
    <p><span class="formSpan">
    <label style="DISPLAY: block" for="06 - Select Operating System"></label>
    <LABEL style="DISPLAY: block" for="06 - Select Operating System">
    *Operating System</label>
    <select name="Operating System">
    <option selected="selected" value=" "></option>
    <option value="XP">XP</option>
    <option value="Vista">Vista</option>
    <option value="Win 7">Win 7</option>
    <option value="Win 8">Win 8</option>
    <option value="Other">Other</option>
    </select>
    <br />
    </span> <span class="formSpan">
    <label style="DISPLAY: block" for="08 - Have you got a Firewall Installed"></label>
    <label style="DISPLAY: block" for="08 - Have you got a Firewall Installed">*Have you got a Firewall Installed</label>
    <label style="DISPLAY: block" for="08 - Have you got a Firewall Installed"></label>
    <p align="justify">
    <input id="08 - Have you got a Firewall Installed" class="fw-textarea" name="08 - Have you got a Firewall Installed" type="input" />
    </p>
    </span><span class="formSpan">
    <label style="DISPLAY: block" for="09 - Have you got AntiVirus Installed"></label>
    <label style="DISPLAY: block" for="09 - Have you got AntiVirus Installed">*Have you got AntiVirus Installed</label>
    <p align="justify">
    <input id="09 - Have you got AntiVirus Installed" class="fw-textarea" name="09 - Have you got AntiVirus Installed" type="input" />
    </p>
    </span>
    <p class="formSpan" align="justify">*Please state the type of support you need. Please tick all that apply</p>
    <span class="formSpan">
    <p align="justify"><br />
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Email support" type="checkbox" />
    Email support
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="General advice" type="checkbox" />
    General advice
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Remote support" type="checkbox" />
    Remote support
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Report a problem with the site" type="checkbox" />
    Report a problem with the site</p>
    <p align="justify">
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Software problems" type="checkbox" />
    Software problems
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Hardware problems" type="checkbox" />
    Hardware problems
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Data backup" type="checkbox" />
    Data backup
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Data recovery" type="checkbox" />
    Data recovery</p>
    <p align="justify">
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Laptop" type="checkbox" />
    Laptop
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Desktop Tower" type="checkbox" />
    Desktop Tower
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Desktop midi" type="checkbox" />
    Desktop midi
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Other" type="checkbox" />
    Other
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Virus-Spyware removal" type="checkbox" />
    Virus-Spyware removal</p>
    <p align="justify">
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Internet problems" type="checkbox" />
    Internet problems
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Wireless conectivity" type="checkbox" />
    Wireless conectivity
    <input name="10 - Please state the type of support you need. Please tick all that apply" value="Home visit" type="checkbox" />
    Home visit</p>

    <p align="justify"><span class="formSpan">
    <textarea cols="70" rows="15" name="*Message"></textarea></span>
    </p>
    </form>
    <input name="Submit" type="submit" dir="ltr" lang="en" onclick="Submit" value="Submit" xml:lang="en" />
    <input name="recipient" value="correctemail.com" type="hidden" />
    <input name="subject" value="Thank you For Submitting you query " type="hidden" />
    <input name="redirect" value="http://torfaenpcrepair.com/ThankYou.html?_cache=1348966966" type="hidden" />
    <input name="missing_fields_redirect" value="http://torfaenpcrepair.com/contact%20Us.html?_cache=1348967037" type="hidden" />
    <input name="required" type="hidden" />
    </FORM>
    <div class="fw-paragraphbottom" align="justify"></div>
    </span>
    </LABEL>
    </LABEL>
    </span>
    </body>

    </html>
    Last edited by TPCR; 10-02-2012 at 01:59 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •