2 Replies Latest reply: Oct 13, 2014 6:09 PM by JohnSSmith RSS

    Web Form Error Message

    JohnSSmith Community Member

      I have a very large collection form although it only has 14 "Required fields

       

      When I press submit, I get a new page with the following message -

       

      ERROR: An error occurred. Your web form must capture customer name and email address. Please fix this issue and re-insert your web form on your web page.

       

      Name and email are definitely there, and I have tested every field and submitted data.


      However if I enter just my name and email address, then all the other required fields are ignored.

       

      I cut down the code to only include the fields that are important to check - same result

       

      here it is

       

      <script type="text/javascript" src="http://propertywealthpartners.businesscatalyst.com/CatalystScripts/ValidationFunctions.js"></script>

                  <script type="text/javascript">

      //<![CDATA[

      var submitcount75734 = 0;function checkWholeForm75734(theForm){var why = "";if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, "First Name");if (theForm.LastName) why += isEmpty(theForm.LastName.value, "Last Name");if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value);if (theForm.HomeAddress) why += isEmpty(theForm.HomeAddress.value, "Home Address");if (theForm.HomeCity) why += isEmpty(theForm.HomeCity.value, "Home City");if (theForm.HomeState) why += isEmpty(theForm.HomeState.value, "Home State");if (theForm.HomeZip) why += isEmpty(theForm.HomeZip.value, "Home Zipcode");if (theForm.HomeCountry) why += checkDropdown(theForm.HomeCountry.value, "Home Country");if (theForm.CellPhone) why += isEmpty(theForm.CellPhone.value, "Cell Phone Number");if (theForm.CAT_Custom_19946743) why += isEmpty(theForm.CAT_Custom_19946743.value, "Your Age");if (theForm.CAT_Custom_19946749) why += checkDropdown(theForm.CAT_Custom_19946749.value, "Marital Status");if (theForm.CAT_Custom_19946750) why += checkDropdown(theForm.CAT_Custom_19946750.value, "Living Arrangements");if (theForm.CAT_Custom_19947405) why += isEmpty(theForm.CAT_Custom_19947405.value, "What would you like to discuss at our first meeting?");if (theForm.CAT_Custom_19947406) why += isEmpty(theForm.CAT_Custom_19947406.value, "What would you like to achieve in the next 5 years.");if (theForm.CAT_Custom_19948331) why += checkDropdown(theForm.CAT_Custom_19948331.value, "Please read and consent to our use of your information as per our Privacy Statement");

      if(why != ""){alert(why);return false;}if(submitcount75734 == 0){submitcount75734++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}

      //]]>

      </script>

       

      I checked it against another smaller form, which is working but can't see any difference between the first few lines and last lines.


        • 1. Re: Web Form Error Message
          JohnSSmith Community Member

          OK fixed - the number at top of form was different than the script checking the form.

           

          I realised that each time a web form is changed it gets a new number. catwebformformXXXXX

           

          However the problem is if you have done quite a bit of CSS formatting (taking out all the tables) and then add new fields, although the number changes within the javascript check, you only copy the new code and new javascript, so you don't have to do all the formatting again.

          To fix, you have to then manually change the number at the top as well.

           

          I suppose this problem will not occur if you format within the web form itself.

          • 2. Re: Web Form Error Message
            JohnSSmith Community Member

            I want to add something here, for others

             

            When formatting within the Customise Web Form" (other action) itself, be careful as the result is divorced from any changes made to the webform

             

            For example Newsletter sign up - with the webform newsletter was chosen and within "Customise Web Form" I could see the newsletter, however the list number was wrong, after checking the html code within the tables, and it does not update.

             

            Even adding a new list, did not actually add the new list to the "Customise Web Form" area, so it needs to be manually added. FYI anyone that did not know that.