Required field validation not working

Gurus,
I've made fields mandatory on dozens of forms in the past without any issue.
I'm currently developing a custom form with Disposition values which are required. My "create" page indicates the fields are required with an astrick but is not enforcing the value after clicking on my "apply" button.
Any ideas?
This is happening for both client side and server side. Disable Server side validation is set to "false".
Thanks,
Scott
Edited by: sreese on Nov 29, 2010 2:56 PM

After further analysis, I was able to resolve myself:
Set "Apply" button Disable Server Side Validation and Disable Client Side Validation = False.

Similar Messages

  • Multivalued lookup field validation not working

    Hi Experts ,
    I have a scenario where one of my table is looking to a multivalued look up table .
    I have placed a validation on the main table , which works fine if the first value is selected properly , but if i select a wrong record (which should fail according to the vlidation ) it does not fail .
    Eg : For a multivalued field first value i have slected as "TRUE" (which is correct ) - No validation error (as expected)
    again if i seltect another value "FALSE" (WHICH IS WRONG) - No validation error ( Not as expected)
    on the other hand if i select the wrong value in the first attampt the validation fails (which is as expected) .
    Please let me know what has to be done .
    Regards,
    Vignesh

    Hi,
    Can you please explain in details whats your requirement is?
    Many thanks
    Regards,
    Kiran

  • Field validation not working if text added to SO Header.

    In include MV45AFZZ at the end I check that the payment terms have not been modified to credit, so I added this code in FORM USEREXIT_SAVE_DOCUMENT_PREPARE:
    IF xvbkd-zterm <> yvbkd-zterm.
    And I can change the quantity in the Sales order, but if I change the header text, this condition is triggered even if I did not change the payment terms.
    Anyone has an idea why?
    Thank you.
    Regards,
    Carlos

    Hi,
    Can you please explain in details whats your requirement is?
    Many thanks
    Regards,
    Kiran

  • Publishing HTML(Page content) field required field validation is not working

    The required field validation is not working on Site Column of type "Full HTML content with formatting and constraints for publishing". I found a link i.e.
    https://social.msdn.microsoft.com/Forums/office/en-US/7b544aae-2562-4b8e-8e5b-36a1d47a4d14/publishing-htmlpage-content-field-required-field-validation-is-not-working?forum=sharepointdevelopment
    which tells this is a hot fix in July 2014 CU . Can anyone help me with what all Fixes are there in July 2014 CU. So that I can update only if it required!
    Or any other alternative where I can use the required field validator on "Full HTML content with formatting and constraints for publishing" column type?

    You could add a scripteditor webpart on the newform.aspx page and add client side validation using jQuery.
    $(document).ready(function()
     var fname = document.getElementById('fname').val();
     var lname = document.getElementById('lname').val();
     var age = document.getElementById('age').val();
     /*Do not know how to get element by class and that too, two different type. Have to check if user chose anything or not*/
      $("#submit").click(function()
       if(fname.length === 0)
        alert("Please input a first name");
       else if(lname.length === 0)
        alert("Please input a last name");
       else if(age.length === 0)
        alert("Please input an age");

  • How to block the 'save' function when the required fields are not filled?

    Hello, Everyone
    I am new for this scripting. My question is:
    How to block the 'save' function when the required fields are not filled?
    I designed a PDF file with some required fields and I do not want the user to save the document until all required fields are filled. My idea is to write some scripts in Willsave method like:
    if (this.getField("Family Name").value == ""){
    app.alert('You should fill the Family Name field firstly!');
    But I do not think it works as finally the document is saved after all.
    Please help me on that!
    So much thanks.

    Dear Randybearwang,
    I am a Rocky myself and I know how though it is to establish some good codes. Since I created some forms with validation options myself I might have a code for you. The code also creates an alert box (Yes/no option) if the user chooses yes the form will be validatet, if he chooses "no" the alert window will be closed.If  everything is filled out correctly the form will be saved otherwise the textbox will be higlighted and gets focus.
    If you need further assistance , please let me know
    Have fun with the code.
    P.s I don´t know how to upload the "PDF" document. I wrote you an email, please get back to me if you still need the file.

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Field value not working as "Can grow" when exported in PDF

    Hi, I have a unique problem. We have a report which is using a sub-report. When we run that report in Crystal report and preview then it looks fine. This subreport is designated as "can  grow" so if the field length is bigger than the size then it is coming in the second row. Everything works fine except when we export this report in PDF.
    When we export in PDF then this field is not working as "Can grow" and remaining value of the fields is  truncated. This is happening both in XI and 2008 version of Crystal client.
    Thanks,

    Hi, This is declared as bug by Business Objects Support and Product team will decide if they want to include fix in next release (or fix). This is not possible before Dec 2009 or Early 2010. 
    Below are the general steps on how to apply the suggested workaround:
    1. Remove the on-demand subreport caption, and add an empty string to it instead.
    1.1 In the u201CDesignu201D view of the report, right click on the subreport and select u201CFormat Subreportu2026u201D
    1.2 In u201CFormat Editoru201D window, under the tab u201CSubreportu201D, click on the u201CX-2u201D button of the option u201COn-Demand Subreport Captionu201D
    1.3 In the u201CFormula Workshopu201D window, highlight the text in the formula, and cut it. ( Ctrl-X)
    ( We are just copying the text, as we need to use the samething for the formula or text object we will use to replace this. )
    1.4 Type the following in the formula: u201Cu201D
    1.5 Click on the button u201CSave and closeu201D, to close the u201CFormula Workshopu201D
    1.6 Back to the u201CFormat Editoru201D window, click on the u201COKu201D button to accept the change.
    2. Create a formula or insert a text object in which you add the text or fields you will like to display
    ( In the following steps we will be using a formula )
    2.1 In the u201CField Exploreru201D, right click on u201CFormula Fieldsu201D and select u201CNewu201D
    2.2 In the u201CFormula Nameu201D window, type the name of the formula. ( Example: My subreport caption )
    2.3 In the u201CFormula Workshopu201D, copy the text you cut in step 1.3, or simply add the database fields and text you will like to display for your on-demand subreport caption.
    2.4 Save and close the formula by clicking on the u201CSave and closeu201D button
    3. Insert the formula over the on-demand subreport, and resize the field to be of the desired length.
    4. Format the formula to display like a hyperlink. ( Blue font and underlined text )
    4.1 Right click on the formula inserted in step 3, and select u201CFormat Fieldu2026u201D
    4.2 In the u201CFormat Editoru201D, under the tab u201CFontu201D, set the color to blue
    4.3 Still under the tab u201CFontu201D, check the u201CEffectsu201D option u201CUnderlineu201D
    4.4 Under the tab u201CCommonu201D, check the option u201CCan Growu201D
    4.5 Click on the u201COKu201D button to accept the change
    5. Move the formula to the back in order to ensure you can drill-down on the on-demand subreport
    5.1 Right click on the formula inserted above the on-demand subreport and select u201CMove u2013 To Backu201D
    Now, when exporting the report to PDF format, the formula used to replace the u201Con-demand subreport captionu201D that displays more than one line will all be exported.
    This workaround has following limitations:
    The User can see the service description in two lines because of the u2018Text Objectu2019, the On demand subreport is not growing into the second line in the crystal report since we removed the caption.
    So the user has to carefully click on the first line of the description in the main report to open the subreport. If he clicks on the second line then it wonu2019t open the required subreport and it may create confusion.
    If we manually stretch out the subreport to occupy two lines space then it will leave a gap in between when we have only 1 line service description.
    So plan ahead of time about how lengthy text in su-report would be.

  • Bypass Required Field Validation when needed in PDF Dynamic Form

    I faced a tricky situation, where some fields are required, but we need to allow bypass required (mandatory) validation rule when saving the form, and require to fill such fields when submitting the form. In other words, provide flexible control when to turn On / Off this feature.
    I wanted to implement a flexible solution, and I will post my findings here. Appreciate your feedback for improvements.
    Steps:
    1. Mark rquired fields as required.
    2. Specify "Empty Message" as "This field cannot be left blank", or similar.
    3. Specify "Validation Script Message" as "This field must have a proper value before submit", or similar.
    4. Create a Global Form Level Variable something like "StopTotalValidation" and default as "1" means by default, Turn Off Validation for some cases.
    5. For the fields which require this type of control, add the script (to be defined later) on the "validate" event:
    myTools.validateForRequiredField(this);
    6. Create a Script Object "myTools" and add the following script:
    function initStringFunc() {
    //call this function on Document Initialize
    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
    String.prototype.ltrim = function() {
        return this.replace(/^\s+/,"");
    String.prototype.rtrim = function() {
        return this.replace(/\s+$/,"");
    String.prototype.isEmpty = function() {
        return (this == null) || this.trim() == "";
    function setNodeProperty(theNode, theProperty, newValue) {
       if (theNode[theProperty] != newValue) {
            theNode[theProperty] = newValue; 
    function isNodePropertyEmpty(theNode, theProperty) {
        var result;
        if (theNode == null || theNode[theProperty] == null) {
            result = true;
        } else {
            result = theNode[theProperty].isEmpty();
        return result;
    function disableTotalValidation() {
        StopTotalValidation.value = "1";
    function enableTotalValidation() {
        StopTotalValidation.value = "0";
    function isTotalValidationOn() {
        return StopTotalValidation.value != "1";
    function isTotalValidationOff() {
        return StopTotalValidation.value == "1";
    const conRequired = "(required)";
    function validateForRequiredField(theFld) {
        // Bypass Required Field Validation when Global Validation is Off.
        var result=false;
        if (theFld) {
            if (theFld.mandatory && theFld.mandatory == "error") {
                if (myTools.isNodePropertyEmpty(theFld, "rawValue")) {
                    myTools.setNodeProperty(theFld, "rawValue", conRequired);
                if (isTotalValidationOn()) {
                    if (isNodePropertyEmpty(theFld, "rawValue") || theFld.rawValue.toLowerCase() == conRequired.toLowerCase()) {
                        result = false;
                    } else {
                        result = true;
                } else {
                    result = true;             
        } else {
            result = false;
        return result;
    7. Now, on the click of "Save" button call the function "disableTotalValidation()" and on the click of "Submit" button call the function "enableTotalValidation()".
    I have just finished implementing the above solution, and as per my initial testing, it is working fine.
    I will post this to my Google Docs workspace, and provide updates their.
    Tarek.

    Hi Tarek,
    I see what you mean in relation to clarity if you used the form variable approach. It was only a suggestion. Like so many things in LC, there is more than one way to finding a solution to a problem.
    The triple equal sign (===) is testing if the condition is equal, but to a higher standard. It is testing if the values are identical to each other. For example if you were testing if a textfield was empty, with Equality (==) you might have this:
    if (this.rawValue == null || this.rawValue == "") {
         // Some script
    If you use Identity (===) you can do the same thing with less script:
    if (this.rawValue === null) {
         // Some script
    It is also useful when testing the value of an object, but also the type (eg string, number, Boolean).
    Lastly, it can be used for non-identity (!==).
    In relation to createNode() etc, apart from John's blog, it is covered in the LC documents: http://www.adobe.com/support/documentation/en/livecycle/documentation.html. Look for the scripting guides and the guide to the XML Form Object Model.
    Good luck,
    Niall

  • Spry email validation not working [was: Please help!]

    When visitors contact me via the contact form on my website ( http://clockdoctors.co.uk/Contact%20me.html) the 'email spry validation field' is not working. The message that i receive in my inbox from this form doesnt show their email address and so i have no way of getting back to them.
    Please can anyone help!?
    Here is the form-to-mail.php
    <?php
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    //Validate first
    if(empty($name)||empty($visitor_email))
        echo "Name and email are mandatory!";
        exit;
    if(IsInjected($visitor_email))
        echo "Bad email value!";
        exit;
    $email_from = '$visitor_email \r\n';//<== update the email address
    $email_subject = "New Form submission";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $message".
    $to = "[email protected],[email protected]";//<== update the email address
    $headers = "From: $email_from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: http://clockdoctors.co.uk/Thanks20%.html');
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>
    [Subject line edited by moderator to indicate nature of problem]

    Ok this is my, form-to-mail.php. Is this what you need to view or is there something else?
    <?php
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    //Validate first
    if(empty($name)||empty($visitor_email))
        echo "Name and email are mandatory!";
        exit;
    if(IsInjected($visitor_email))
        echo "Bad email value!";
        exit;
    $email_from = "$visitor_email \r\n";//<== update the email address
    $email_subject = "New Form submission";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $message".
    $to = "[email protected],[email protected]";//<== update the email address
    $headers = "From: $email_from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: http://clockdoctors.co.uk/Thanks20%.html');
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>

  • Validation not working on Qualified Field!!!! is this Normal!!!

    Hi All,
    I have an Integer field in the Qualified table.
    Name-> Non Qualifier -> Type Text
    Code -> Qualifier -> type Integer
    Now, i need to write a  validation which throws error If user enters a number whose length is  less than 4 or greater than 4.
    The business requirement is User should enter Exactly 4 Numeric values. Not less and not more.
    As integer type field done not control Field length i have written a validation.
    I have written a validation..
    IF(IS_NULL(MAINLOOKUP.Code),1,IF(LEN(MAINLOOKUP.Code)<4 , 0 ))
    But this is not working.
    this works for a Normal Integer field which is in Main table, But this is not working when Code field is in Qualified table!!!
    Is this the normal Behaviour of MDM??
    Or am i missing something!!!
    Experts please provide your suggestions.
    Note: i changed the Code field to Text and made length as 4 in field property, But this is not controlling if user keys in only 2 values.
    So written the above validation on text field as well, But it does not work.
    Kind Regards
    Eva

    Hello Eva
    Ok
    Just imagine
    you have some record in your main table with some QLUT
    Qlut contain next fields
    item_name - type text
    item_value - type integer qualified = yes
    and list of values
    q1
    q2
    q3
    q4
    your main table contain next fields
    name-text
    Qlut->your Qlut
    qlut_code->text
    qlut_value_>text
    For qlut_code create assignment like Qlut.code
    For qlut_value create assignment like Qlut.value
    add some records to main table like this:
    name=test1
    in qlut select next:
    item name =Q1
    item value=1
    item name =Q2
    item value=2
    item name =Q3
    item value=3
    and another one record in main like this:
    name=test2
    in qlut select next:
    item name =Q1
    item value=1
    item name =Q3
    item value=3
    item name =Q4
    item value=4
    item name =Q3
    item value=33
    select both records and run both assignments
    If your assignments is correct
    In first main record you have got
    qlut_code=3:Q1;Q2;Q3
    qlut_value_>3:1;2;3
    for second main record you have got
    qlut_code=4:Q1;Q3;Q4;Q3
    qlut_value_>4:1;3;4;33
    Then you can use records values from qlut_code and qlut_value for validation
    This is work fine.
    I hope, you have got my point
    Regards
    Kanstantsin Chernichenka
    Edited by: kanstantsin_ch on Oct 6, 2011 1:35 PM

  • Unchecking Required Field from Form Field is not working

    I am trying to un-check a field to a disable the required field function and it will not let me uncheck the box, its ghosted out. Upon filling out the form as-is > I enter text in the field as it requires and even after entering information it gives me an error and says its not filled out??!!!! I spent a lot of time on this form and do not have the time to recreate it just to risk getting the same result....

    Hi
    Did you rename the email field to Last Name? That's the only entry which will not let you uncheck this option.

  • Validation not working when clearing an open item

    Hi SAP Gurus,
    We have a interesting scenario to discuss with you. We are using Legal Dunning Procedure so once legal action is intiated against the customer notifications are sent to the legal department if payments are received.
    Unfortunately this can happen only during the next dunning run which of course can occur in varying time intrevals. Therefore we need a validation to occur if a payment is received from a customer against whom legal action has been initiated.
    We tried using the following fields Date of the legal dunning proceedings, Dunning block, Dunning key, Dunning level but are not able to get the validation to work when attempting to clear the open item. These all work when trying to post a new document but fail when trying to clear a open item. Points will be given for helpful answers.
    Regards,
    Siva

    this is the radio button
    <af:selectOneRadio value="#{bindings.Gender1.inputValue}"
                                                     label="#{bindings.Gender1.label}"
                                                     required="#{bindings.Gender1.hints.mandatory}"
                                                     shortDesc="#{bindings.Gender1.hints.tooltip}"
                                                     id="sor5">
                <f:selectItems value="#{bindings.Gender1.items}" id="si7"/>
              </af:selectOneRadio>
    i use this sample
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Insider_Essentials/ADF_Insider_Essential_YesNoRadio/ADF_Insider_Essential_YesNoRadio.html

  • 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

  • Spry validation not working in IE9

    I am using DW CS5.5 and have a form on a PHP page and have set spry validation for 2 text fields and a textarea.
    Also using CAPTCHA on the form.
    The 2 text fields are a simple required validation and the textarea is required plus a max character validation
    It works in Firefox, Chrome, Safari, Opera, and IE Compatibility View, but does not work in IE9.
    The CAPTCHA works in IE9 and all other browsers but can't get the spry validation to work.
    Here is the page
    http://www.fandapartyrentals.com/testimonials.php

    altruistic gramps wrote:
    It is up to you, you could remove the counter; personally I would leave it there because once the focus has moved from the text area, the number of (remaining) words will show.
    Another solution is to force IE8 standards document mode as in
    <head>
      <!-- Mimic Internet Explorer 8 -->
      <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
      <title>My webpage</title>
    </head>
    The problem with the above is that the rendering will also follow IE8 mode.
    Gramps
    Thanks for your help,
    I used the meta tag to emulate IE8 and it works as needed.

  • 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.

Maybe you are looking for