Feedback form validation not working

Hi all,
My feedback form i am put form validation its not working, please help me,
my entire code is given below
<?php
          /* ========================= CODE WILL EXECUTE WHEN FORM WILL SUBMIT =====================*/
                    if($_GET["formFilledStatus"]=="t")
                              $name = $_GET['txtName'];
                              $email = $_GET['txtEmail'];
                              $phone          =          $_GET['txtPhone'];
                              $dateofappoitment          =          $_GET['txtDOA'];
                              $timeofappoitment          =          $_GET['txtTA'];
                              $userRequirement = $_GET['txtSuggestion'];
                              $to= "[email protected]";
                              $subject = "FEEDBACK & ENQUIRY FORM";
                              $message = "<BR><B> User Name:- </B>".$name."<BR><BR><B> Email:- </B>".$email."<BR><BR><B> Phone:- </B>".$phone."<BR><BR><B>Date of Appoitment:-</B><BR>".$dateofappoitment."<BR><BR><B> Time of Appoitment:- </B>".$timeofappoitment."<BR><BR>                                <B> Address:- </B>".$userRequirement;
                              $headers  = "MIME-Version: 1.0\r\n";
                              $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
                              $headers .= "From:".$email;
                              // Additional headers
                              //$headers .= 'Bcc: [email protected]' . "\r\n";
                              $mailStatus=mail($to, $subject, $message, $headers);
                    /* ========================= END CODE =====================*/
?>
<script language="javascript">
function isEmail(email)
                    if(email.indexOf("@") != "-1" && email.indexOf(".") != "-1")
                    return true;
                    else
                    return false;
          function validate()
                    if(document.enquiryForm.txtName.value=="")
                              alert("Name required!");
                              document.enquiryForm.txtName.focus();
                              return false;
                    if(document.enquiryForm.txtPhone.value=="")
                              alert("Please Enter your Phone!");
                              document.enquiryForm.txtPhone.focus();
                              return false;
                    if(document.enquiryForm.txtDOA.value=="")
                              alert("Please Select your date of appoitment!");
                              document.enquiryForm.txtDOA.focus();
                              return false;
                    if(document.enquiryForm.txtTA.value=="")
                              alert("Please Enter time of appoitment!");
                              document.enquiryForm.txtTA.focus();
                              return false;
                    if(document.enquiryForm.txtSuggestion.value=="")
                              alert("Please Enter your address!");
                              document.enquiryForm.txtSuggestion.focus();
                              return false;
</SCRIPT>
<style type="text/css">
<!--
.home_page_font {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 11px;
          font-style: normal;
          line-height: normal;
          font-weight: bold;
          font-variant: normal;
          text-transform: none;
          color: #333333;
          text-align: justify;
.home_page_font1 {          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 11.6px;
          font-style: normal;
          line-height: normal;
          font-weight: normal;
          font-variant: normal;
          text-transform: none;
          color: #333333;
          text-align: justify;
.home_page_font1 {          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 11px;
          font-style: normal;
          line-height: normal;
          font-weight: normal;
          font-variant: normal;
          text-transform: none;
          color: #868d98;
          text-align: justify;
.style6 {color: #000000}
-->
</style>
        <FORM ACTION="" METHOD="GET" NAME="enquiryForm1" ONSUBMIT=" return validate()">
                    <INPUT TYPE="HIDDEN" NAME="formFilledStatus" VALUE="t">
               <DIV ALIGN="LEFT">
        <TABLE WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="3" CELLSPACING="0" BORDERCOLOR="#F1D6D6" class="home_page_font1" STYLE="border-collapse:collapse;">
        <?php
                    /* ============ CODE IF MAIL SUCCESSFULLY SENT ====================== */
                    if($mailStatus)
                    ?>
              <TR>
            <TD COLSPAN="2" HEIGHT="25">
            <DIV class="c-text1" ALIGN="CENTER"><b>
            <h3 class="style6">Your Enquiry Has Been Successfully Sent.<b></h3>
            </DIV></TD>
          </TR>
                      <?
                      /*================== CODE END ====================================== */
?>
                      <TR>
            <TD COLSPAN="2" HEIGHT="25">
            <DIV class="home_page_font" ALIGN="CENTER">
              <div align="left">Suggestion &amp; Feedback Form</div>
            </DIV></TD>
          </TR>
          <TR>
            <TD class="power-com1"><FONT COLOR="#FF0000">* </FONT> <STRONG>Your
            Name :</STRONG></TD>
            <TD><INPUT NAME="txtName" SIZE="35" MAXLENGTH="48" VALUE="" class="txtfld"></TD>
          </TR>
          <TR>
            <TD class="power-com1"> </TD>
            <TD> </TD>
          </TR>
          <TR>
            <TD class="power-com1"><STRONG>Your
            E-Mail : </STRONG></TD>
            <TD><INPUT NAME="txtEmail" MAXLENGTH="48" SIZE="35" VALUE="" class="txtfld"></TD>
          </TR>
          <TR>
            <TD class="power-com1"> </TD>
            <TD> </TD>
          </TR>
          <TR>
            <TD class="power-com1"><FONT COLOR="#FF0000">* </FONT><STRONG>Phone/Mobile
            :</STRONG><br>(Include Country/Area Code)</TD>
            <TD><INPUT TYPE="TEXT" NAME="txtPhone" SIZE="22" MAXLENGTH="60" VALUE="" class="txtfld"></TD>
          </TR>
          <TR>
            <TD class="power-com1"> </TD>
            <TD> </TD>
          </TR>
          <TR>
            <TD class="power-com1"><STRONG><font color="#FF0000">*</font>Date of Appoitment :</STRONG><br>(Include Country/
            Area Code)</TD>
            <TD><INPUT TYPE="TEXT" NAME="txtDOA" SIZE="22" MAXLENGTH="60" VALUE="" class="txtfld" id="txtDOA"></TD>
          </TR>
          <TR>
            <TD class="power-com1"> </TD>
            <TD> </TD>
          </TR>
          <TR>
            <TD class="power-com1"><STRONG><font color="#FF0000">*</font>Time of Appoitment : </STRONG></TD>
            <TD><INPUT NAME="txtTA" SIZE="35" VALUE="" class="txtfld" id="txtTA"></TD>
          </TR>
          <TR>
            <TD class="power-com1"> </TD>
            <TD> </TD>
          </TR>
          <TR>
            <TD VALIGN="TOP" class="power-com1"> </TD>
            <TD> </TD>
          </TR>
          <TR>
            <TD VALIGN="TOP" class="power-com1"><FONT COLOR="#FF0000">* </FONT> <STRONG>Address</STRONG></TD>
            <TD><TEXTAREA NAME="txtSuggestion" ROWS="3" COLS="29" WRAP="Virtual" class="txtfld"></TEXTAREA></TD>
          </TR>
          <TR>
            <TD COLSPAN="2">
            <CENTER><INPUT TYPE="SUBMIT" NAME="" VALUE="Submit Query">
            <INPUT TYPE="RESET" NAME="Reset1"></CENTER></TD>
          </TR>
        </TABLE>
          </DIV></FORM>

Rather than reinventing the wheel, I tend to use SpryValidation widgets to validate the form using JavaScript. However, to ensure that no validation is untouched, you also need to validate the inputs using serverside script.
The example that you have shown is valiadtion in JavaScript. This means that anyone with JS turned off will bypass your validation.
Gramps

Similar Messages

  • HTML 5 Contact Form "Placeholder" instead of label makes form validation not work

    Hi,
    I am trying to implement a HTML 5 contact form which uses a "placeholder" within the field instead of a label. But now the form validation does not work.
    The site is at http://www.partnerrealestate.ch/avenuedefrance23/index.html and it is not using any workflows from BC as the person receiving it is an external person and the process does not require a workflow.
    Would appreciate any input into this.
    Kindest Regards,
    corina

    There is no label on input fields. The form does not work because you have edited the names. BC needs the ID and names to be as it is issue when you create the form so it knows what to use for the validation and what information to pass into the database.
    So where you have edited these, you need to restore those.
    You have some invalid html on some input's as well one has input="" inside of it when rendered so that is not right.
    It is not to do with placeholder use. So fix up your HTML errors, correct the name and ID changes and it will work fine.

  • Tabular Form Validation not working in tabular form APEX 4.0

    Hi,
    I am using APEX 4.0. I have a tabular form with Tabular form validation done with it.
    Item not null is the validation.. so if I dont type any value in the any of the fields in the tabular form and press the Submit button, the first time error is shown... but when I click the Submit button again, with still the empty rows the page is submitted.
    How to resolve this issue?
    Edited by: Suzi on Oct 5, 2010 11:13 AM

    Look at this thread - Re: Validations of tabular forms in 4.0

  • HTML Snippet for FEEDBACK FORM does not work the way I expected

    Hello folks,
    I have used following code as a Snippet to create a FEEDBACK FORM, so people can send their comments. I was hoping that when people write their comments and click Send, the comment will be sent directly to my e-mail. Instead, after clicking Send button, the Mail Manager pops up. So it is pretty much the same as if they click on the e-mail address link. Is this normal? I thought, that these comments will be sent directly via that FEEDBACK FORM, not via Mail Manager.
    Thank you so much for any tip or response.
    This is the Snippet Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
    <html>
    <head>
    <title>form</title>
    </head>
    <body>
    <FORM METHOD="POST" ACTION="mailto:[email protected]?subject=Please email me with your feedback"ENCTYPE="text/plain">
    Please enter your name
    <INPUT TYPE="text" NAME="name" SIZE="30">
    Please enter your email address
    <INPUT TYPE="text" Name="usermail" size="50">
    Add any comments below
    <TEXTAREA NAME="comment" ROWS=6 COLS=60></TEXTAREA>
    Clicking "Send it" will launch your mail application
    <INPUT TYPE=submit VALUE="Send it!">
    <INPUT TYPE=reset VALUE="Reset Form">
    </FORM>
    </body>
    </html>

    The action is usually a php file.
    Otherwise, simply create a button and make it a mail link in the Inspector.
    If you cannot figure this out, you'd better refrain from using it.
    Or start learning how to use forms.

  • Client Side Javascript Validation not Working in Struts 1.x version

    hi,
    I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work.
    [http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/]
    "The framework automatically generates the browser specific JavaScript and validate the data only at the client side."From the above statement i undertstand that framework itself generates the javascript function for validating the field mentioned in validations.xml file so that we dont have to explicitly write a javascript function for
    validating the fields
    (or)
    Do we need to call an explicit function
    Please need help on this.
    I have followed all the steps mentioned on the above link but Client Side Javascript Validation not Working in Struts 1.x version....
    Thanks and Regards,
    Deepak

    Hi,
    Please find my steps below....still getting an error.
    2> which version of commons-validation.jar needs to be downloaded ...Link please
        downloaded the latest commons-validation.jar and placed in lib.refreshed the project,and did a build.
        3> which DTD name to be specified in "validator-rules.xml" which is in accordance to commons-validator.jar file.
    validator-rules.xml ::
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">validation.xml:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    i did as u said and im gettiong the below errorNov 5, 2009 4:33:08 PM org.apache.struts.validator.ValidatorPlugIn initResources
    SEVERE: Invalid byte 2 of 2-byte UTF-8 sequence.
    org.apache.commons.digester.xmlrules.XmlLoadException: Invalid byte 2 of 2-byte UTF-8 sequence.
         at org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(FromXmlRuleSet.java:139)
         at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610)
         at org.apache.commons.digester.xmlrules.DigesterLoader.createDigester(DigesterLoader.java:89)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:122)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:238)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:181)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1036)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
         at javax.servlet.GenericServlet.init(GenericServlet.java:212)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:448)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Need help forum members.....
    Please reply to my question 1  which has been asked before as belowDo i need to write explicit javascript function for validation in Struts (or) struts generates the javascript function by itself.??? Please explain with an example....
    Edited by: Deepak_A_L on Nov 5, 2009 4:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Forms Personalization not working after R12 upgrade

    Hi,
    We have recently upgraded to R12. We have forms personalizations on the People, Enter and Maintain form and this is not working now after the R12 upgrade.
    I went to one of the form personalizations and Validated and Applied again but it still did not work. I also created a new one but had no success with that either.
    Any ideas how to get this working again ? Is there something extra that needs to be done for R12?
    Thanks
    Regards,
    Shalantha

    Pl indicate which version of R12 and on what form you had the personalization in the previous version. Have you checked FND_FORM_CUSTOM_% tables to ensure that the personalization survived the upgrade ?
    Pl see if these MOS Docs can help
    Forms Personalizations Unavailable After Upgrade To 12.1.x          (Doc ID 1245864.1)
    Forms Personalization Not Working After Upgrade To R12.1.3          (Doc ID 1309458.1)
    Form Personalization Value Field Not Being Retained After Upgrade          (Doc ID 1266265.1)
    Do Personalizations Holdup After A Patch Is Applied? (Doc ID 1286576.1)
    HTH
    Srini

  • Form is not working of multiple form check boxs, source posted. HELP.

    Form is not working of multiple form check boxs, source posted. HELP.
    I'm trying to have golive form be able to check one, two or all of the options in Graphics field.
    As is it will only post results from the last checked box.
    Here's the page
    http://www.perfection-press.com/Pages/ContactForm.html
    Here's where source in golive has scanning,design,filesupplied.
    [code removed to fix forum topic display]

    Since the checkboxes all have the same name, the values are over-writing each other when being passed to the PHP script. The best way to fix that is to add a pair of empty square [] brackets after the checkbox names, so make the names "graphics[]" instead of "graphics". That tells PHP that the values are being passed as a list (an array) instead of a single value. As long as your processing script knows what to do from there (and it does), should solve the problem.
    By the way, I noticed that two of the checkboxes were named "graphics" and the other was "graphic" (singular). You'll want to fix that too so they're all the same.

  • My 'contact' form is not working.  When I send a test contact it returns to my adobe email account this: "Contact Form" has a new form submission.

    My 'contact' form is not working.  When I send a test contact it returns to my adobe email account this:
    "Contact Form" has a new form submission.

    What exactly is not working ? As you have mentioned form submission notification is received in your email account so form process is working I believe but you want the notifications to go to another email account I think.
    Have you added the email address in "Email to" field in form options ? If yes and then also you are not receiving the form , then please provide me the site url and post a screenshot or form with option box open.
    Thanks,
    Sanjit

  • My start and end form is not working .

    My start and end form is not working .
    It showing error that start form in invalid.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
       DIALOG                            = 'X'
       FORM                              = 'YSAMPLE1'
       LANGUAGE                          =  SY-LANGU.
    loop at itab1.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = '525'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'.
    endloop.
    CALL FUNCTION 'START_FORM'
    EXPORTING
      ARCHIVE_INDEX          =
       FORM                   = 'ysample1'
      LANGUAGE               = ' '
       STARTPAGE              = 'next'.
       CALL FUNCTION 'END_FORM'.
    Thanks and regards
    Mave
    CALL FUNCTION 'CLOSE_FORM'.

    You should use END_FORM and START_FORM when you want to say to your system:
    - OK! Here document print begins and there it finishes.
    Infact you can print many document opening the sapscript only one time:
    CALL OPEN_FORM
    LOOP MY_DOCUMETS.
    Here the print of document starts:
      CALL START_FORM
      CALL WRITE_FORM
      CALL WRITE_FORM
    Here the print of document finishes
      CALL END_FORM
    ENDLOOP.
    CALL CLOSE_FORM.

  • Form does not work

    Hi
    I use Adobe Livecycle Designer7.0 English and Acrobat7.0.8 Japanese. I made forms to upload to Workflow Server. One form I made does not work at all when the form is opened in the Form Manager.
    It is strange that the PDF preview of the Designer works well.
    1. Page Counter
    In the master page of the form I set a page counter field from the custom library. In the preview it works well but when the form is opened from Form Manager it does not work. It looks like "Page ##/##".
    2. Font is not shown
    I put a button in the form. The font of the button is set to "MS UI Gothic", but when the form is opened from Form Manager the font of the button is "KozukaMincho".
    3. JavaScript does not work
    I wrote javascript to change the caption of fields like this.
    ----- form1.#subform[0].Button1::click - (Javascript, client)
    FieldA.rawValue = "test";
    FieldB.rawValue = "test2";
    This script does not work too when the form is opened.
    These issues are basic but I do not know where is wrong. Because no error message appears when I test the form in the PC.
    Please advise about these issues.
    Thanks,
    Akira

    Hi Jared,<br /><br />I am very glad to read your reply. <br />I added a button with the script you wrote in previous reply and found that Form Manager changed the root tag. <br /><br />The xsd file I define to the data is like this<br /><br />b <Message>  //rootnode name <br /><br /> <Heade></Header><br /> <Contents><br />  <FieldA></FieldA><br />  ......<br /> </Contents><br /> <Footer><Footer><br /></Message><br /><br />So, I set the structure of the form like this.<br /><br />b <Message>          //This is name of contents area<br /><br /> <Header></Header> //Subform name<br /> <Contents>        //Subform name<br />  <FieldA></FieldA><br />   ......<br /> </Contents><br /> <Footer></Footer> // Subform name<br /></Message> <br /><br />But the saveXML script write out like this:<br /><br />b <fields><br /><br /> <Header></Header><br /> <Contents><br />  <FieldA></FieldA><br />  ......<br /> </Contents><br /> <Footer></Footer><br /></fields> <br /><br />So I changed all of the Javascript using relative path and I upload this form again to the FM, but this form does not work...<br />I am not sure that it must be the same name between the rootnode of the xsd file and the name of the contents area. <br /><br />Jared and all, would you let me know whatever you find about this issues.<br /><br />Best regards,<br />Akira

  • Spry Validations not working javascript:Spry.Widget.Form.destroyAll() in popup

    iam using spry to validate controls in a popup.in that
    validations are working fine but the problem is when we click
    cancel button also thse validations are firing...
    i am using
    javascript:Spry.Widget.Form.destroyAll() to destroy
    validations...but it is not working.
    when we click on cancel button how to destroy the validations
    as well as hide the popup...
    can anyone help me...

    Thanks! (While I'm REALLY not comfortable with code yet (working on it :-) I atleast understood that it was a PHP issue (yay).
    Studied the code in the examples in the book. And added:
    <pre>
    <?php if ($_POST) {print_r($_POST);} ?>
    </pre>
    It worked.  (I'm local testing, with no connection to a database yet. Just trying to get the basic pages to work first.)
    Hopefully the more I work on all of this, the more I'll begin to "get it"! And I'm almost up to the Chapter on PHP. So, I'm hoping to will become clearer as I read on.
    Thanks for the help in pointing me in the right direction!!!
    -- Jami

  • PHP email form with Validation - not working

    Hello;
    I am new to using php. I usually use coldfusion or asp but this site requires me to write in php. I have a form I am trying to get to work and right now.. it doesn't do anyhting but remember what you put in the fields. It doesn't want to send, and it won't execute the validation script for the fields that are required. Can anyone help me make this work? I'm confused and a definate newbie to PHP.
    Here is my code:
    <?php    
                  $PHP_SELF = $_SERVER['PHP_SELF'];   
                  $errName    = "";   
                  $errEmail    = "";
                  $errPhone    = "";        
                  if(isset($_POST['submit'])) {        
                          if($_POST["ac"]=="login"){            
                        $FORMOK = TRUE;    // $FORMOK acts as a flag. If you enter any of the conditionals below,                             // it gets set to FALSE, and the e-mail will not be sent.
                        // First Name           
                        if(preg_match("/^[a-zA-Z -]+$/", $_POST["name"]) === 0) {               
                            $errName = '<div class="errtext">Please enter you name.</div>';               
                            $FORMOK = FALSE;           
                        // Email           
                    if(preg_match("/^[a-zA-Z]\w+(\.\w+)*\@\w+(\.[0-9a-zA-Z]+)*\.[a-zA-Z]{2,4}$/", $_POST["email"]) === 0) {                                                    $errEmail = '<div class="errtext">Please enter a valid email.</div>';               
                            $FORMOK = FALSE;           
                        // Phone           
                        if(preg_match("/^[a-zA-Z -]+$/", $_POST["phone"]) === 0) {               
                            $errPhone = '<div class="errtext">Please enter your phone number.</div>';               
                            $FORMOK = FALSE;           
                        if($FORMOK) {               
                                $to = "[email protected]";  
                                $subject = "my. - Contact Form";                  
                                $name_field = $_POST['name'];               
                                $email_field = $_POST['email'];               
                                $phone_field = $_POST['phone'];
                                $city_field = $_POST['city'];
                                $state_field = $_POST['state'];               
                                $message = $_POST['comment'];                
                                $message = "               
                                Name: $name_field               
                                Email: $email_field
                                Phone: $phone_field   
                                City: $city_field   
                                State: $state_field               
                                Message: $message";                
                                $headers  = 'MIME-Version: 1.0' . "\r\n";               
                                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";                
                                // Additional headers               
                                $headers .= 'To: <[email protected]>' . "\r\n";               
                                $headers .= '[From] <$email_field>' . "\r\n";                
                                // Mail it               
                                mail($to, $subject, $message, $headers);                
                                header("Location: thankyou.php")
                                // I have no idea what these next 3 lines are for. You may just want to get rid of them.                   
    ini_set("sendmail_from","[Send from]");
    ini_set("SMTP","[mail server]");
    mail($to, $subject, $message, $headers);
                                } else {               
                                echo "Error!";              
                        ?>
    <form method="post" action="<?php $PHP_SELF ?>" id="commentForm">
    <input name="name" size="40" value="<?php echo $_POST["name"]; ?>" type="text">
                         <?php  if(isset($errName)) echo $errName; ?>
    <input name="email" size="40" value="<?php echo $_POST["email"]; ?>"  type="text">
            <?php  if(isset($errEmail)) echo $errEmail; ?>
    <input name="phone" size="40" value="<?php echo $_POST["phone"]; ?>" type="text" id="phone">
            <?php  if(isset($errPhone)) echo $errPhone; ?>
    <input name="city" size="40" value="<?php echo $_POST["city"]; ?>" type="text" id="city">
    <input name="state" size="40" value="<?php echo $_POST["state"]; ?>" type="text" id="state">
    <textarea name="comment" cols="30" rows="10" id="comment"><?php echo $_POST["comment"]; ?></textarea>
    <input type="submit" value="Submit" name="submit" class="contact-submit" />
    </form>
    It seems pretty simple.. but it's not working at all. I would also like this page to submit to it's self, and when it actually does send an email, to just make the form disappear and replace it with the thank you text instead of sending you to another page. I also do not need to use an smtp server, it goes directly to the network server when sent.
    I'm really sorry to ask all of this, I'm trying to learn this language and need to make this work.
    Thank you for anyones help in advance.

    .oO(BarryGBrown)
    > I have a php file which generates an email from a form
    in a website I have
    >designed. I just want to make some areas of the final
    generated email in bold
    >text. I know if people have plain text only selected in
    their email client they
    >won't see the bold text, but at least it will reach a
    certain percentage of
    >users.
    You can't do bold text in a normal email. Plain text is just
    that -
    plain text. For anything more you need HTML. _If_ you should
    need it.
    Usually plain text serves pretty well and is the most
    efficient way.
    > the line in question is -
    >
    > $body ="Booking request details from website:\n\n";
    >
    > I have tried putting  and ,
    syntax is used in some forum software, but besides that it
    has
    no meaning whatsoever.
    >inside the inverted commas, outside
    >etc, plus tried different declarations within the
    <head>, nothing works! What
    >am I doing wrong?
    You would have to create an entire HTML email with all the
    required
    headers and boundaries. Quite difficult to do by hand with
    PHP's mail()
    function.
    > I am a beginner with this php stuff, please be kind!
    Then you should start simple with plain text. There are some
    classes out
    there which make it easy to generate text and HTML emails
    (phpmailer for
    example), but you should be familiar with PHP coding if you
    want to use
    them.
    Micha

  • Moved from 104.11 to 10.5.2 php email feedback forms don't work now

    Just moved from 10.4.11 to 10.5.2 with default Apache2 and PHP versions as provided by the 10.5 Server installer.
    We have a simple web site, static pages, integrated filemaker content, and a couple of php scripts.
    Our simple slideshow scripts work fine. Our feedback scripts do not.
    User fills in the form and hits send which is set to post the field content to the php script with in turn sends an email to the appropriate address and then calls a "thank you for your submission" page. Until this OS change the browser never does anything other than what is described above. With the OS change the browser now looks like it is trying to load the script page and then gives this error:
    "Safari can’t open the page “http://www.wetzelandson.com/feedback.php” because the server unexpectedly dropped the connection, which sometimes occurs when the server is busy. You might be able to open the page later."
    The script runs some checks for empty fields, incomplete email address and verify that a mail server is on the domain for the users email address. The script works, diverting to error pages as needed, until the user puts in a complete email address at which point it stalls, shows that the browser is trying to load the php script and shows the message.

    Figured it out.
    I guess something about the new php in 10.5.2 does not like the verification of an mx server at the domain of the users email
    commented the following and script works fine now, it worked until I changed from 10.4.11 to 10.5.2.
    I guess that this command is no longer valid.
    function validateemail($email)
    list($userName, $mailDomain) = split("@", $email);
    return checkdnsrr($mailDomain, "MX");
    if (validateemail($email))
    */

  • Spry validation not working in latest FF or Chrome

    Hello,
    A simple Spry validation script that we're using is not working in the latest editions of Firefox or Chrome. (However it is working in IE).  Meaning, it doesn't validate the form elements as it's supposed to (like missing email address) except for in IE. I can't seem to crack this one. Please have a look at the page:
    http://www.golfturf.rutgers.edu/lp/Copy%20of%203-week-turf-short-course-lp1.asp
    Any help would be appreciated. Thank you.

    Arnout,
    Thank you for your input and for catching that folder pointing issue. However I fixed that and it still didn't remedy the issue. I would update the the latest Spry but I'm not sure that's needed because I have another page using the same Spry where the validation is working perfect in all browsers:
    http://www.golfturf.rutgers.edu/ppc-turf-form.html
    Everything looks the same.
    Can you offer any more advice?
    Thank you,

  • Spry select menu validation not working for all menus

    This is VERY strange...I have two menus which show depending on the selection in another menu.  The other, or main, menu has the spry validation working fine.  So does the validation for one of the other 'child' menus.  But the other child menu validation does not work, despite the fact that the code is nearly identical for both except for the spry ids and select ids (of course).  You can see the form working at:
    https://registrations.ucc.usyd.edu.au/profile.php
    If you select, say, Arts faculty from the faculty menu, then you will get another menu for schools.  Validation works for these when the submit button is pressed.  However, if you select 'Not Faculty' from the faculty menu another menu will show instead of the school menu.  This is the menu that is not validating.
    I have attached my php page for the code in this form.
    The same problem exists for other menus that are in hidden divs further down the page.
    Any help appreciated!!!!

    Your key is the "suitcase fusion for a font manager" line.
    There is a bug where you won't be able to create a button if you have a bad font, or a duplicate font, installed.
    First try shutting off all of the fonts you have open with Suitcase, and see if that helps. If so, open one suitcase at a time until you figure out which font is the culprit.
    If shutting off all but the basic System fonts does not help, you might have to reinstall your system, or somehow update your core System fonts. I don't know how to do that, but there was a recent article at http://www.tidbits.com/ that discussed fonts and their maintenance. But ultimately it's a font problem.

Maybe you are looking for