Struts Validation not working

As far as I can tell I can't see anything wrong with my validation on struts, but if I put nothing into a required field it doesn't report an error. Any ideas? Below is the offending code:
First Validation.xml
<form-validation>
    <formset>
        <form name="User">
            <field property="email"
                    depends="required,email">
                <arg0 key="user.email"/>
            </field>
        </form>
    </formset>
</form-validation>Next my struts-config.xml:
<form-bean name="User" type="org.apache.struts.validator.DynaValidatorForm">
         <form-property name="userName" type="java.lang.String"/>
         <form-property name="password" type="java.lang.String"/>
         <form-property name="firstName" type="java.lang.String"/>
         <form-property name="lastName" type="java.lang.String"/>
         <form-property name="email" type="java.lang.String"/>
</form-bean>next the jsp code:
<html:form action="/profile?action=save">
<html:errors/><BR><BR>
<tr>
     <td align="left" valign="top"><font face="Arial, Helvetica" size="2">Email:</font></td>
     <td></td>
     <td align="left"><html:text property="email" size="35" maxlength="255" /><br><font size="1"><i>(Your name @ your company web site address)</i></font></td>
</tr>
</form>And my Action code:
          else if (action.equals("save")){
               errors = form.validate(mapping, request);
               if ((errors == null) || (errors.isEmpty())){
                    //Save Item goes here
                    return (mapping.findForward("Profile"));
               else {
                    saveErrors(request, errors);
                    return (mapping.findForward("show"));
          }And my validator-rules.xml (it is the default one that comes with struts, but I included it just in case)
<form-validation>
   <global>
      <validator name="required"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateRequired"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
                  msg="errors.required">
         <javascript><![CDATA[
            function validateRequired(form) {
                var isValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oRequired = new required();
                for (x in oRequired) {
                     var field = form[oRequired[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea' ||
                        field.type == 'file' ||
                        field.type == 'select-one' ||
                        field.type == 'radio' ||
                        field.type == 'password') {
                        var value = '';
                              // get field's value
                              if (field.type == "select-one") {
                                   var si = field.selectedIndex;
                                   if (si >= 0) {
                                        value = field.options[si].value;
                              } else {
                                   value = field.value;
                        if (trim(value).length == 0) {
                             if (i == 0) {
                                 focusField = field;
                             fields[i++] = oRequired[x][1];
                             isValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return isValid;
            // Trim whitespace from left and right sides of s.
            function trim(s) {
                return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
            ]]>
         </javascript>
      </validator>
      <validator name="requiredif"
                 classname="org.apache.struts.validator.FieldChecks"
                 method="validateRequiredIf"
                 methodParams="java.lang.Object,
                               org.apache.commons.validator.ValidatorAction,
                               org.apache.commons.validator.Field,
                               org.apache.struts.action.ActionErrors,
                               org.apache.commons.validator.Validator,
                               javax.servlet.http.HttpServletRequest"
                 msg="errors.required">
      </validator>
      <validator name="minlength"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMinLength"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.minlength">
         <javascript><![CDATA[
            function validateMinLength(form) {
                var isValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oMinLength = new minlength();
                for (x in oMinLength) {
                    var field = form[oMinLength[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea') {
                        var iMin = parseInt(oMinLength[x][2]("minlength"));
                        if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
                            if (i == 0) {
                                focusField = field;
                            fields[i++] = oMinLength[x][1];
                            isValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return isValid;
            }]]>
         </javascript>
      </validator>
      <validator name="maxlength"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMaxLength"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.maxlength">
         <javascript><![CDATA[
            function validateMaxLength(form) {
                var isValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oMaxLength = new maxlength();
                for (x in oMaxLength) {
                    var field = form[oMaxLength[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea') {
                        var iMax = parseInt(oMaxLength[x][2]("maxlength"));
                        if (field.value.length > iMax) {
                            if (i == 0) {
                                focusField = field;
                            fields[i++] = oMaxLength[x][1];
                            isValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return isValid;
            }]]>
         </javascript>
      </validator>
      <validator name="mask"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMask"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.invalid">
         <javascript><![CDATA[
            function validateMask(form) {
                var isValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oMasked = new mask();
                for (x in oMasked) {
                    var field = form[oMasked[x][0]];
                    if ((field.type == 'text' ||
                         field.type == 'textarea') &&
                         (field.value.length > 0)) {
                        if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
                            if (i == 0) {
                                focusField = field;
                            fields[i++] = oMasked[x][1];
                            isValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return isValid;
            function matchPattern(value, mask) {
               return mask.exec(value);
            }]]>
         </javascript>
      </validator>
      <validator name="byte"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateByte"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.byte"
       jsFunctionName="ByteValidations">
         <javascript><![CDATA[
            function validateByte(form) {
                var bValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oByte = new ByteValidations();
                for (x in oByte) {
                     var field = form[oByte[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea' ||
                        field.type == 'select-one' ||
                              field.type == 'radio') {
                              var value = '';
                              // get field's value
                              if (field.type == "select-one") {
                                   var si = field.selectedIndex;
                                   if (si >= 0) {
                                        value = field.options[si].value;
                              } else {
                                   value = field.value;
                        if (value.length > 0) {
                            if (!isAllDigits(value)) {
                                bValid = false;
                                if (i == 0) {
                                    focusField = field;
                                fields[i++] = oByte[x][1];
                            } else {
                                 var iValue = parseInt(value);
                                 if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
                                     if (i == 0) {
                                         focusField = field;
                                     fields[i++] = oByte[x][1];
                                     bValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return bValid;
            }]]>
         </javascript>
      </validator>
      <validator name="short"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateShort"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.short"
       jsFunctionName="ShortValidations">
         <javascript><![CDATA[
            function validateShort(form) {
                var bValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oShort = new ShortValidations();
                for (x in oShort) {
                     var field = form[oShort[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea' ||
                        field.type == 'select-one' ||
                        field.type == 'radio') {
                        var value = '';
                              // get field's value
                              if (field.type == "select-one") {
                                   var si = field.selectedIndex;
                                   if (si >= 0) {
                                        value = field.options[si].value;
                              } else {
                                   value = field.value;
                        if (value.length > 0) {
                            if (!isAllDigits(value)) {
                                bValid = false;
                                if (i == 0) {
                                    focusField = field;
                                fields[i++] = oShort[x][1];
                            } else {
                                 var iValue = parseInt(value);
                                 if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
                                     if (i == 0) {
                                         focusField = field;
                                     fields[i++] = oShort[x][1];
                                     bValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return bValid;
            }]]>
         </javascript>
      </validator>
      <validator name="integer"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateInteger"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.integer"
       jsFunctionName="IntegerValidations">
         <javascript><![CDATA[
            function validateInteger(form) {
                var bValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oInteger = new IntegerValidations();
                for (x in oInteger) {
                     var field = form[oInteger[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea' ||
                        field.type == 'select-one' ||
                        field.type == 'radio') {
                        var value = '';
                              // get field's value
                              if (field.type == "select-one") {
                                   var si = field.selectedIndex;
                                  if (si >= 0) {
                                       value = field.options[si].value;
                              } else {
                                   value = field.value;
                        if (value.length > 0) {
                            if (!isAllDigits(value)) {
                                bValid = false;
                                if (i == 0) {
                                     focusField = field;
                                      fields[i++] = oInteger[x][1];
                            } else {
                                 var iValue = parseInt(value);
                                 if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
                                     if (i == 0) {
                                         focusField = field;
                                     fields[i++] = oInteger[x][1];
                                     bValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return bValid;
            function isAllDigits(argvalue) {
                argvalue = argvalue.toString();
                var validChars = "0123456789";
                var startFrom = 0;
                if (argvalue.substring(0, 2) == "0x") {
                   validChars = "0123456789abcdefABCDEF";
                   startFrom = 2;
                } else if (argvalue.charAt(0) == "0") {
                   validChars = "01234567";
                   startFrom = 1;
                } else if (argvalue.charAt(0) == "-") {
                    startFrom = 1;
                for (var n = startFrom; n < argvalue.length; n++) {
                    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
                return true;
            }]]>
         </javascript>
      </validator>
      <validator name="long"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateLong"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.long"/>
      <validator name="float"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateFloat"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.float"
       jsFunctionName="FloatValidations">
         <javascript><![CDATA[
            function validateFloat(form) {
                var bValid = true;
                var focusField = null;
                var i = 0;
                var fields = new Array();
                oFloat = new FloatValidations();
                for (x in oFloat) {
                     var field = form[oFloat[x][0]];
                    if (field.type == 'text' ||
                        field.type == 'textarea' ||
                        field.type == 'select-one' ||
                        field.type == 'radio') {
                         var value = '';
                              // get field's value
                              if (field.type == "select-one") {
                                   var si = field.selectedIndex;
                                   if (si >= 0) {
                                       value = field.options[si].value;
                              } else {
                                   value = field.value;
                        if (value.length > 0) {
                            // remove '.' before checking digits
                            var tempArray = value.split('.');
                            var joinedString= tempArray.join('');
                            if (!isAllDigits(joinedString)) {
                                bValid = false;
                                if (i == 0) {
                                    focusField = field;
                                fields[i++] = oFloat[x][1];
                            } else {
                                 var iValue = parseFloat(value);
                                 if (isNaN(iValue)) {
                                     if (i == 0) {
                                         focusField = field;
                                     fields[i++] = oFloat[x][1];
                                     bValid = false;
                if (fields.length > 0) {
                   focusField.focus();
                   alert(fields.join('\n'));
                return bValid;
            }]]>
         </javascript>
      </validator>
      <validator name="double"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateDouble"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.double"/>
      <validator name="date"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateDate"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              depends=""
                  msg="errors.date"
       jsFunctionName="DateValidations">
         <javascript><![CDATA[
            function validateDate(form) {
               var bValid = true;
               var focusField = null;
               var i = 0;
               var fields = new Array();
               oDate = new DateValidations();
               for (x in oDate) {
                   var value = form[oDate[x][0]].value;
                   var datePattern = oDate[x][2]("datePatternStrict");
                   if ((form[oDate[x][0]].type == 'text' ||
                        form[oDate[x][0]].type == 'textarea') &&
                       (value.length > 0) &&
                       (datePattern.length > 0)) {
                     var MONTH = "MM";
                     var DAY = "dd";
                     var YEAR = "yyyy";
                     var orderMonth = datePattern.indexOf(MONTH);
                     var orderDay = datePattern.indexOf(DAY);
                     var orderYear = datePattern.indexOf(YEAR);
                     if ((orderDay < orderYear && orderDay > orderMonth)) {
                         var iDelim1 = orderMonth + MONTH.length;
                         var iDelim2 = orderDay + DAY.length;
                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
                         if (iDelim1 == orderDay && iDelim2 == orderYear) {
                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
                         } else if (iDelim1 == orderDay) {
                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
                         } else if (iDelim2 == orderYear) {
                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
                         } else {
                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
                         var matched = dateRegexp.exec(value);
                         if(matched != null) {
                            if (!isValidDate(matched[2], matched[1], matched[3])) {
                               if (i == 0) {
                                   focusField = form[oDate[x][0]];
                               fields[i++] = oDate[x][1];
                               bValid =  false;
                         } else {
                            if (i == 0) {
                                focusField = form[oDate[x][0]];
                            fields[i++] = oDate[x][1];
                            bValid =  false;
                     } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
                         var iDelim1 = orderDay + DAY.length;
                         var iDelim2 = orderMonth + MONTH.length;
                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
                         if (iDelim1 == orderMonth && iDelim2 == orderYear) {
                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
                         } else if (iDelim1 == orderMonth) {
                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
                         } else if (iDelim2 == orderYear) {
                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
                         } else {
                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
                         var matched = dateRegexp.exec(value);
                         if(matched != null) {
                             if (!isValidDate(matched[1], matched[2], matched[3])) {
                                 if (i == 0) {
                                     focusField = form[oDate[x][0]];
                                 fields[i++] = oDate[x][1];
                                 bValid =  false;
                         } else {
                             if (i == 0) {
                                 focusField = form[oDate[x][0]];
                             fields[i++] = oDate[x][1];
                             bValid =  false;
                     } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
                         var iDelim1 = orderYear + YEAR.length;
                         var iDelim2 = orderMonth + MONTH.length;
                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
                         if (iDelim1 == orderMonth && iDelim2 == orderDay) {
                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
                         } else if (iDelim1 == orderMonth) {
                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
                         } else if (iDelim2 == orderDay) {
                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
                         } else {
                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{2})$");
                         var matched = dateRegexp.exec(value);
                         if(matched != null) {
                             if (!isValidDate(matched[3], matched[2], matched[1])) {
                                 if (i == 0) {
                                     focusField = form[oDate[x][0]];
                                  fields[i++] = oDate[x][1];
                                  bValid =  false;
                          } else {
                              if (i == 0) {
                                  focusField = form[oDate[x][0]];
                              fields[i++] = oDate[x][1];
                              bValid =  false;
                     } else {
                         if (i == 0) {
                             focusField = form[oDate[x][0]];
                         fields[i++] = oDate[x][1];
                         bValid =  false;
               if (fields.length > 0) {
                  focusField.focus();
                  alert(fields.join('\n'));
               return bValid;
         function isValidDate(day, month, year) {
             if (month < 1 || month > 12) {
                    return false;
                if (day < 1 || day > 31) {
                    return false;
                if ((month == 4 || month == 6 || month == 9 || month == 11) &&
                    (day == 31)) {
                    return false;
                if (month == 2) {
                    var leap = (year % 4 == 0 &&
                               (year % 100 != 0 || year % 400 == 0));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

Next my struts-config.xml:That's all? What about an <action-mappings> section
which specifies the action URIs and whether or not
validation is turned on for specific ones?Whoops, sorry I forgot to put my action, although you just made me figure out the answer. I forgot I have 2 versions of the bean, one called Profile and one Called User, and I was trying to test the validation on the Profile bean while I was specifying the User bean :)

Similar Messages

  • Struts validation not working properly

    Hi,
    I'm using the struts validator to validate my form.. I've followed all the steps required.. I've checked it quite a few times :)
    Currently I want to verify if my form fields have any value, so am verifying the required property.. but when I submit an empty form, it doesn't show an error.. but the log shows the following;
    Any suggestions what could be missing?
    2005-08-11 16:20:08,804 [http-8080-Processor25] ERROR org.apache.struts.validator.ValidatorForm - org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest)
    org.apache.commons.validator.ValidatorException: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest)
         at org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:627)
         at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
         at org.apache.commons.validator.Field.validateForRule(Field.java:827)
         at org.apache.commons.validator.Field.validate(Field.java:906)
         at org.apache.commons.validator.Form.validate(Form.java:174)
         at org.apache.commons.validator.Validator.validate(Validator.java:367)
         at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)
         at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

    I had a similar problem upgrading from struts 1.1 to 1.2.7. The method signatures in FieldChecks changed to include a Validator object:
    1.1
    validateRequired(java.lang.Object bean, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field, ActionErrors errors, javax.servlet.http.HttpServletRequest request)
    1.2.7
    validateRequired(java.lang.Object bean, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field, ActionMessages errors, org.apache.commons.validator.Validator validator, javax.servlet.http.HttpServletRequest request)
    After I added org.apache.commons.validator.Validator to the methodParams attribute of validator in validator-rules.xml I no longer got the error (which was a NoSuchMethodException... I had to look at the ValidatorAction code to find that out, for some reason it wasn't in the stack trace).

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can't get Struts validator to work with ADF 10.1.3.36.73 in Jdev 10.1.3.0.4

    I am attempting to use the "How to Use the Struts Validator Plug-in with JDeveloper 10g" written by Duncan in a JDeveloper 10.1.3.0.4 application with standard model/ViewController projects. I am using JSP/Struts/ADF technologies.
    I have performed the below:
    Struts Config:
    <form-bean name="surveyDataForm" type="oracle.adf.controller.v2.struts.forms.BindingContainerValidationForm" className="oracle.adf.controller.struts.forms.BindingContainerValidationFormConfig"/>
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    In the 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">
    <form-validations>
    <formset>
    <form name="surveyDataForm">
    <field property="EmpName" depends="required">
    <arg0 key="survey.name"/>
    </field>
    <field property="DateOfService" depends="required">
    <arg0 key="survey.service.date"/>
    </field>
    <field property="ReloContractor" depends="required">
    <arg0 key="survey.relo.contract"/>
    </field>
    </form>
    </formset>
    </form-validations>
    And in my JSP, I have:
    <script type="text/javascript">
    <html:javascript formName="surveyDataForm"/>
    </script>
    <html:form action="/survey.do" onsubmit="return validateSurveyDataForm(this)">
    (The validation-rules.xml was copied from the JDev install jakarta-struts folder).
    I can now see the Javascript showing up in my JSP page, but I don't have a method generated for validateSurveyDataForm or any form like this. I didn't think I had to create this. Also, even without the Javascript, the validator is not called because the JBO errors for required are still showing up. The only thing I have not done is included the modelReference in the Form Bean definition in the struts-config.xml. I'm not sure this will work, or even what to populate this with, as the UIModel.xml is replaced by PageDef.xml and DataBindings.cpx changes.
    Anyone have any ideas?
    Shay

    Only have one network; wireless. On it's own, the MacBook can use wifi to surf the net and Apple TV can watch movie previews from Apple via wifi.
    It did work about two months ago. I haven't used it since then for home sharing but have used the Apple TV on its own.
    I read the Troubleshooting page on Apple Support. It involves turning various things on and off, which I did

  • 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

  • Validation not working during Mass Change of Vendor Line Items

    Hi All,
    I created validation for Reference Key 1 field of Vendor line items, in this validation i used customized user exit.
    Whenever i select multiple line items in FBL1N for mass change & try to put a unauthenticated value system gives error as per Validation only for 1 st item but it not work for subsequent items & put the unauthenticated value in subsequent line items.
    I am not able to understand why Validation is working only for 1st line item during mass change & not for subsequent line items.
    Please provide your suggestions in resolving this issue.
    Thanks
    sandeep

    Hello Sandeep,
    I understand your issue. First check if the changes as per the SAP Note 640908 (https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=640908) is available in your system.
    Actually, Mass changes call FB02 in background and at this stage Validation gets activated and hence, the control doesn't go back for the next item changes. You can test this by deactivating the Validation and then the mass changes will me fine.
    I hope this explains the behaviour.
    Thanks and regards,
    Suresh Jayanthi.

  • XML Validation Not Working.

    Hi Dear Experts.
    I have an scenario Proxy to JDBC - Dual Stack , on Receiver Agreement I checked the option Validation by Integration Engine . I made a test in Test Message on NWA Task and the validation is fine. However when I sent the message from ABAP Proxy the validation is not working.
    Can you help me?
    Regards.

    Can you see your xsd in NWA??
    NWA → Cache Monitoring → Mapping Runtime.
    or
    PIMON → Monitoring → Mapping Runtime → Cache Monitor
    @Sarojkanta Parida : IN PI 7.4 version we dont need to place xsd in any location, We just need to select Schema Validation option in Sender/Receiver Agreement, and it will be activated.
    Regards
    Osman

  • 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

  • Item Level Validation Not Working As Supposed To...

    Hi All,
    I have an item validation type: SQL(Not Exist) that checks whether the value in the id number field exists in the database when Create button is clicked. If the id number exists in the database then an error message is displayed in line with the field & the transaction doesn't go through; however, when this happens Apply Changes & Delete button appear & Create button dissapear. It's as if the record has already been inserted. I would like this validation to work like the Not Null validations.
    I repeated this process several times without success & now I can't even create a new user or update & delete existing ones - I get the error:
    ORA-06550: line 1, column 7: PLS-00428: an INTO clause is expected in this SELECT statement
    ORA-2015: User ID number already exists in the database.NB:The second message is the one I use whenever there's duplicates so, it's oracle reserved message. Any help is highly appreciated.
    Regards
    Kamo

    The buttons probably have conditions to appear if a certain item is not null. You can set this item to null as part of the validation, e.g.,
    :P1_X := null;
    ...but to do that you'd need to change the validation type to PL/SQL Function Returning Boolean and code the "not exists" logic into the PL/SQL block.
    Scott

  • Validation not working when application is in portal

    hi i have a stuation where my unique validation are working when i run application as standalone but when i put application in portal is working ,am adding my application in portal by creating ADF JAR and aadd the jar in my portal,am in jdeveloper 11.1.1.6.0

    am doing validation in entity level
    <validation:UniqueKeyValidationBean
        Name="UamOrganisations_Rule_0"
        ResId=".model.entities.UamOrganisations_Rule_0"
        KeyName="AltKey">
        <validation:OnAttributes>
          <validation:Item
            Value="Organisationname"/>
        </validation:OnAttributes>
      </validation:UniqueKeyValidationBean>
    is still not working even if i set immediate=true
    <af:inputText value="#{bindings.Organisationname.inputValue}"
                                      simple="true"
                                      columns="20"
                                      maximumLength="#{bindings.Organisationname.hints.precision}"
                                      shortDesc="#{bindings.Organisationname.hints.tooltip}"
                                      id="it1" autoSubmit="true" required="true"
                                      immediate="true">
                          <f:validator binding="#{bindings.Organisationname.validator}"/>
                        </af:inputText>

  • Validation not Working in WBS Element

    Dear Team,
    I have created a Validation at WBS element level like this:-
    Prerequisite
    PROJ-PROFL = 'ZPSSNR'
    Check
    PRPS-POSID : 1-6 := PROJ-PSPID : 1-6:
    Error:
    WBS ID doesn't start with Project ID
    My Project ID "SN-001"
    Now when I tried create 1st Level WBS element ( which is Identical to Project ID), it is working fine but in 2nd  level onwards it raised erorr. For example, I tried to create WBS at 2nd Level like "SN-001-CIV" then system throw error.
    Kindly help me to resolve the issue.
    Regards
    Soumen Das

    Hi,
    For your case Use the data as below it would work fine for all the level WBS.
    Prerequisitie:
    PROJ-PROFL = 'Your project profile' AND PRPS-STUFE >= '1'
    Check:
    PRPS-POSID :1-5: = PROJ-PSPID :1-5:
    Message:
    Your required message number.
    Note in Check i am asking to use 1:5 because the special symbols should not be considered.
    Now your validation should work fine.
    Regards,
    Pradeep

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

  • Validation not working for FK01

    Hi Guys,
    I have written a validation using GGB0 where in i want to restrict a user for using the transaction code in FK01.
    I have given the prerequisite as below
    SYST-UNAME = 'SRIKANTHD' AND SYST-TCODE = 'FK01'
    and Check = False
    Then give an error message.
    But somehow this validation is not working and i have also activated this in OB28.
    Any ideas will be helpful.
    Thanks,
    Srikanth.

    Dear Srikanth,
    You can choose the button Local Object instead of Save and this information will be ignored.
    Then you will receive one screen to insert the enhancement, insert please SAPMF02K.
    Then click on button Components and then one little screen will ask you to save. Click yes and you will see another screen with Function exit                  EXIT_SAPMF02K_001 fulfilled already.
    Double click on EXIT_SAPMF02K_001 and the system will create the program and after that you should include your own code there.
    I hope it resolves your inquiry.
    Best Regards,
    Vanessa.

  • 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

Maybe you are looking for

  • Copying large video files to PC-external HD

    I need to deliver a large Quicktime-file (5,87 Gb) edited in FCE to someone who will open it on his PC in Avid. It seems to be complicated: First problem is conversion - I need to convert my QT-file to a Windows Media file, right? This can be done wi

  • My iphone 3gs is stuck on the "connect to iTunes" screen!

    I just got my iphone 3gs yesterday. The guy at the AT&t store told me to update it. Yesterday it didnt work, but today it did. I followed all the directions i've got it set up to the wifi. When it came to the "Set up iPhone" screen i selected itunes

  • I tunes says my 5th generation is corrupt

    Itunes said my5th gen nano was corrupt, and I would need to restore it. I held off awhile as My ipod was still fully functional, it just couldnt sync to itunes. I finally decided to restore my nano, now it wont work at all, after restoring it, an ima

  • Converting Name-Value pair to XML

    Hi, I have configured the proxy service to listen for "&" delimited HTTP post string. I have been able to tokenize the "&" delimited string and get the name-value pair as below: ============================================================ <CUSTOMER>

  • Form shrniking when i drag he scroll bar and click the Folder

    Hi all, already i posted this issue. i am not get any replies. now again i posted. when i drag the scroll bar that time also the form shrinking. this form have five matrix. when i click the Folder and change the lost focus that time also its shrinkin