Page 1 of 4 1234 LastLast
Results 1 to 10 of 31

Thread: Form field do not validate

  1. #1
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,433

    Default Form field do not validate

    I've had this site up for over a year now, but the client rang me today and asked if they could have a post code field on it and make it a required field. Thing is, there already is a post code field and all the form fields are supposed to validate as required. So just to check it out, I submitted a completely blank form and guess what? It went off happily and I got my success page up, even though there was no data in the form.

    PLEEEEAAAAASSSSEEE don't tell me v11 forms haven't ever validated correctly, that NoF v11 FormHandler isn't bugged and that I have to do all my v11 sites over again!!!! On top of v12 still not being ready for prime time (at least, I won't use it yet) if v11 didn't work properly in this vital element that's probably all I need to jump ship after 16 years using NoF.

    The offending form is at www.umbrellasgalore.com.au. It's not in navigation but is linked to from every page on the site.
    Last edited by franko; 09-19-2011 at 08:00 AM. Reason: forgot the URL

  2. #2
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,433

    Default

    No comments? No solutions? No-one else experienced this or haven't you bothered checking? This is a serious bug in v11 - can anyone tell me if this failure of function persists in v12?

  3. #3
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz - - - - - - - - - - - www.gotFusion.com
    Posts
    4,452

    Default

    It has always worked for me and still works

    http://www.gotfusion.com/11-aspform/

    http://www.gotfusion.com/11-phpform/

    Does a blank email get sent ? or does the form just fail?

    Are you talking about this page http://www.umbrellasgalore.com.au/html/enquiry.html

    You should not have an html extension on the form page, should be either asp or php
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Support: http://www.gotFusion.com
    NetObjects Fusion Hosting: http://www.gotHosting.biz

  4. #4
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,433

    Default

    Mike, the form doesn't fail; only the field validation fails. So a form with some, all or none of the fields completed will be sent, even though they should be validated as required.
    The .php extension is interesting; NoF generates the page as html and so I've always left it as is. I thought the field validation was javascript, but if it is php then it would make sense that it needs to have a php extension. In which case it would make sense for NoF to generate the page with a php extension if it's using Fomhandler.php to process the form. Interesting, in that all the forms I have generated using Formhandler probably also do not validate either. Sighhhh.....

    I'll try changing the extension and see if that makes any difference. Hmmm, but that means I'll have to regenerate the whole site otherwise all the links to the enquiry page will be broken... Oh well.

  5. #5
    Max
    Guest

    Default Re: Form field do not validate

    Not necessarily - you could put a directive in your .htaccess file to
    parse your html pages as php. The directive will read something like the
    following line (but you may need to contact support to get the exact
    text required for your hosting provider).

    AddHandler php5-fcgi .php .html

    Max

    -----
    franko wrote:
    <snip>
    Hmmm, but that means I'll have to regenerate the whole site otherwise
    all the links to the enquiry page will be broken... Oh well.
    </snip>



  6. #6
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz - - - - - - - - - - - www.gotFusion.com
    Posts
    4,452

    Default

    Quote Originally Posted by franko View Post
    I'll try changing the extension and see if that makes any difference. Hmmm, but that means I'll have to regenerate the whole site otherwise all the links to the enquiry page will be broken... Oh well.
    Just log in with an FTP client and edit the extension on the form page. See if that makes it work before you do anything else. Fusion 11 publishes my forms with the extension I selected in the Tools > Options > Current Site : General tab properties pallet (script language drop down).

    All of the validation is done in the language you selected (php or asp) so you need the proper extension on the form page. I don't have access to your form page coding to see if the php (or asp) coding is written to the file but you should check to make sure that the form handler was enabled and wrote the code. If there is no scripting on the page (should be some above the first line of code and some after the closing form tag) then you have something wonky in your project file. Download the form page to your computer and open it with notepad to see if the scripting was written to the page.

    The 2 Fusion 11 form handler examples I posted above have the proper extension set by the form handler component:

    http://www.gotfusion.com/11-aspform/index.asp

    http://www.gotfusion.com/11-phpform/index.php

    These were named by Fusion at publish.
    Last edited by gotFusion; 09-20-2011 at 01:38 PM.
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Support: http://www.gotFusion.com
    NetObjects Fusion Hosting: http://www.gotHosting.biz

  7. #7
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,433

    Default

    1. The site has always been set to .php extension for scripts, so should have published as .php but didn't; it published as html.
    2. I did as you suggested Mike, logged in, changed the extension to .php, manually loaded the page because, of course, the site links aren't working with the changed extension. Form still went through without validation.
    3. Changed the extension from html to php in site view. Republished the entire site. Uploaded the entire site. Form now has .php extension. Form still submits just fine without any validation at all happening, even a completely empty form. All fields except message field are required.
    4. I'm at a complete loss. The only thing I can think to do now is to use another program to create my forms, and frankly, that's a PITA.

  8. #8
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,433

    Default

    The site options are (and always have been) set to PHP for scripts.
    I did as you suggested, Mike, and changed the form extension to php on the server. Form still happily went through without any validaltion happening; even a completely empty form where all fields are required.
    So then I changed the form page extension in site view from html to php and republished the entire site. NoF published the form as enquiry.php and updated all the links to the form. So far so good. Uploaded the entire site to the server having first deleted all the appropriate pages from the server. Submitted the form. Form still happily submitted without any validation happening at all. It will quite happily submit with all fields filled in, some filled in and some empty, or all empty.
    I'm at a loss. I seem to have two options: 1) use an outside program to create my forms and then insert them via Ctrl-T or 2) rebuild the site in 'that other html generator' knowing that at least the forms will work.

    Here are the form properties:

  9. #9
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz - - - - - - - - - - - www.gotFusion.com
    Posts
    4,452

    Default

    When you look at the code of the page (open the pages on your computer with notepad) do you have the php coding at the top of the page and after the closing form tag? It should look something like this

    Code:
    <?php error_reporting(0);if ( session_id() == "" ) session_start(); ?><?php
    error_reporting(0);
    $nof_suiteName="FormsHandler";
    $nof_debug = "false";
    $nof_langFile = "./scripts/FormsHandler_en.properties";
    $nof_rootDir = ".";
    $nof_scriptDir = "scripts";
    ?>
    <?php
    if (!file_exists($nof_langFile) || !file_exists($nof_rootDir . "/" . $nof_scriptDir . "/" . "nof_utils.inc.php")) {
    if($nof_debug == "true") {
    echo "<p><b>FormsHandler</b> components are not published. Please check your publish settings in Fusion and republish the site.</p>";
    } else {
    echo "<p>An error occured. Please contact the site administrator</p>
    <p>Error code: 103</p>";
    }
    exit();
    }
    
    require_once($nof_rootDir . "/" . $nof_scriptDir . "/" . "nof_utils.inc.php");
    $nof_resources->addFile($nof_langFile);
    ?>
    <?php
    require_once($nof_rootDir . "/" . $nof_scriptDir . "/" . "NOF_CaptchaProperties.class.php");
    ?>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Home</title>
    And the actual form code should have all of this php coding around it

    Code:
    <?php
    if (NOF_fileExists("./scripts/fh_formshandler.php")) {
    ?>
    
    
    <!-- <img id="NOFFormsHandler1" height="243" width="297" src="./icon_formshandlermodule.gif" border="0"> -->
    <form accept-charset='UNKNOWN' method='POST' target='_self' action='./scripts/fh_formshandler.php' name='formshandler1272489180441' enctype='multipart/form-data'><input type="hidden" name="nof_scriptInterfaceFile" value="FormsHandler1272489198812.xml.php">
    <input type="hidden" name="nof_debug" value="false">
    <input type="hidden" name="nof_componentId" value="1272489180441">
    <input type="hidden" name="nof_suiteID" value="1272489198812">
    <input type="hidden" name="nof_componentName" value="formshandler">
    <input type="hidden" name="nof_suiteName" value="FormsHandler">
    <input type="hidden" name="nof_rootDir" value=".">
    <input type="hidden" name="nof_scriptDir" value="scripts">
    <input type="hidden" name="nof_langFile" value="FormsHandler_en.properties">
    <table><tr><td nowrap><label for='name' class='nof_formsHandler_label'>Name</label></td><td nowrap><?php if(isset($_POST["1272489180441_name_errorimg"])) echo stripslashes($_POST["1272489180441_name_errorimg"]); ?></td><td><input class='nof_formsHandler_input_text' id='name' name='name' maxlength='30' value='' size='15' type='TEXT'></td></tr><tr><td nowrap><label for='email' class='nof_formsHandler_label'>Email</label></td><td nowrap><?php if(isset($_POST["1272489180441_email_errorimg"])) echo stripslashes($_POST["1272489180441_email_errorimg"]); ?></td><td><input class='nof_formsHandler_input_text' id='email' name='email' maxlength='30' value='' size='15' type='TEXT'></td></tr><tr><td nowrap><label for='comments' class='nof_formsHandler_label'>Comments</label></td><td nowrap><?php if(isset($_POST["1272489180441_comments_errorimg"])) echo stripslashes($_POST["1272489180441_comments_errorimg"]); ?></td><td><textarea id='comments' rows='5' class='nof_formsHandler_textarea' name='comments' cols='10'></textarea></td></tr><tr><td nowrap><label for='Submit' class='nof_formsHandler_label'></label></td><td nowrap><?php if(isset($_POST["1272489180441_Submit_errorimg"])) echo stripslashes($_POST["1272489180441_Submit_errorimg"]); ?></td><td><input class='nof_formsHandler_input_submit' id='Submit' name='Submit' maxlength='0' value='Submit' size='0' type='SUBMIT'></td></tr><tr><td colspan='3'><?php if(isset($_POST["1272489180441_errormessgs"])) echo stripslashes($_POST["1272489180441_errormessgs"]); ?></td></tr></table></form>
    <?php
    $nof_componentId="1272489180441";
    if (NOF_fileExists("./scripts/fh_remembervalues.php")) include("./scripts/fh_remembervalues.php");
    }
    ?>
    If you don't see this start a new blank 2 page site (one page for the form handler and another page for the success page). Put the form handler component on the page with a simple form, then generate the pages and look at the form page with notepad. Do you get the PHP coding on a new blank site?

    If you set the 2 pages to zero margins it will be easier to follow the coding
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Support: http://www.gotFusion.com
    NetObjects Fusion Hosting: http://www.gotHosting.biz

  10. #10
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,433

    Default

    It doesn't appear to have any php coding on the page at all. So why not? Why isn't NoF doing what it's supposed to have been doing for God knows how many versions?

    I don't use the formhandler component; I design the form on the page and then select the formhandler.php in the form properties. Always worked for me before, although of course, validation probably isn't working on any of my forms.

Posting Permissions

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