Universal Form Validator ASP Support Product Page

This topic is locked
This topic was archived

Custom error message not working - RESOLVED

Reported 15 Aug 2009 20:30:52
1
has this problem
15 Aug 2009 20:30:52 Rune Brynestad posted:
I have a form with 3 required form fields. 2 textboxes and 1 radiogroup. For the textfields I use the standard validation error message for required (This field is required!). For the radiogroup I use a custom error message (Please select).

When I test my form the standard validation error message for required (This field is required!) is used for all 3 fields, also the radiogroup that I have changed to the custom error message "Please select".

You can test it on live URL here:
www.totalweb.no/Test/Outdoorbanquet.asp

And download the source code here:
www.totalweb.no/Test/Test.zip

Regards
Rune

Replies

Replied 15 Aug 2009 20:56:07
15 Aug 2009 20:56:07 Patrick Julicher replied:
Hi Rune,

I had a look at the page and downloaded the code. It happened just like you said.
I then opened the extension and edited the custom message. I saved the settings and my Scriptlibrary was updated. After I uploaded all, it worked.

Have a look at: www.codetogether.com/test/Outdoorbanquet.asp

Kind regards, Patrick
Replied 16 Aug 2009 00:52:16
16 Aug 2009 00:52:16 Rune Brynestad replied:
Hi Patrick

This is very strange. I have opened the extension, edited the custom message and saved it over and over again. Nothing is working as it should. I have version 1.0.1 which I believe is the latest. My script library is not updated when I edit and save my custom message.

Could you please post your modifyed source files as a zip file so I could compare yours and mine?

Thanks again.

Regards
Rune
Replied 16 Aug 2009 14:02:04
16 Aug 2009 14:02:04 Patrick Julicher replied:
Hi Rune,

This is the code on my page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="ScriptLibrary/dmxValidator.asp" -->
<
%' Universal Form Validator ASP 1.0.1
dim dmxval1, DMX_validateAction
set dmxval1 = new dmxValidator
dmxval1.ScriptFolder = "../ScriptLibrary"
dmxval1.CSValidateOnChange = true
dmxval1.CSValidateOnSubmit = true
dmxval1.ReportType = 0
dmxval1.ErrorFont =  "Arial"
dmxval1.ErrorFontSize = 12
dmxval1.ErrorColor = "#FF1A00"
dmxval1.ErrorBold = false
dmxval1.ErrorItalic = false
dmxval1.ErrorImage = ""
dmxval1.UseCustomHintClass = "fixed"
dmxval1.HintBorderColor = "#000000"
dmxval1.HintBorderSize = 1
dmxval1.HintBorderStyle = "solid"
dmxval1.HintBgColor = "#FFFF88"
dmxval1.HintTextColor = "#008C00"
dmxval1.HintTextFont = "Arial"
dmxval1.HintTextSize = 12
dmxval1.HintTextBold = false
dmxval1.HintTextItalic = false
dmxval1.HintBoxWidth = 200
dmxval1.UseCustomFocusClass = "fixed"
dmxval1.FocusBorderStyle = "groove"
dmxval1.FocusBorderSize = 1
dmxval1.FocusBorderColor = "#C3D9FF"
dmxval1.FocusBgColor = "#FFFFFF"
dmxval1.FocusTextColor = "#000000"
dmxval1.UseCustomValidClass = "fixed"
dmxval1.ValidBorderStyle = "groove"
dmxval1.ValidBorderSize = 1
dmxval1.ValidBorderColor = "#00FF00"
dmxval1.ValidBgColor = "#FFFFFF"
dmxval1.ValidTextColor = "#000000"
dmxval1.UseCustomInvalidClass = "fixed"
dmxval1.InvalidBorderStyle = "groove"
dmxval1.InvalidBorderSize = 2
dmxval1.InvalidBorderColor = "#FF0000"
dmxval1.InvalidBgColor = "#FFFFFF"
dmxval1.InvalidTextColor = "#000000"
dmxval1.AddRule "form1", "Name", "allformats", ",,", "true", "", "", "", ""
dmxval1.AddRule "form1", "Office", "allformats", ",,", "true", "", "", "", ""
dmxval1.AddRule "form1", "Accomodation", "allformats", ",,", "true", "Please select!", "", "", ""
dmxval1.Validate
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<% 
' dmxValidatorJSStart
dmxval1.GenerateJavascriptAndCss
' dmxValidatorJSEnd
%>
<script src="../ScriptLibrary/jsvat.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.min.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.inputHintBox.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.validate.min.js" type="text/javascript"></script>
<script src="../ScriptLibrary/dmx.jquery.validate.js" type="text/javascript"></script>
</head>

<body>
<h1>Registration for Outdoorbanquet</h1>
<form id="form1" name="form1" method="post" action="<%=DMX_validateAction%>">
  <table width="700" border="0">
    <tr>
      <td><strong>Name</strong></td>
      <td><label>
        <input name="Name" type="text" id="Name" value="<%= dmxSetValue("", FormRequest("Name")) %>" />
      </label>
      <% dmxval1.GenerateError "form1","Name","allformats",",," %></td>
    </tr>
    <tr>
      <td><strong>Office</strong></td>
      <td><label>
        <input name="Office" type="text" id="Office" value="<%= dmxSetValue("", FormRequest("Office")) %>" />
      </label>
      <% dmxval1.GenerateError "form1","Office","allformats",",," %></td>
    </tr>
    <tr>
      <td><strong>Account number</strong></td>
      <td><label>
        <input name="Accountnumber" type="text" id="Accountnumber" value="<%= dmxSetValue("", FormRequest("Accountnumber")) %>" />
      </label></td>
    </tr>
    <tr>
      <td><strong>Accommodation </strong></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2"><p>
        <label>
          <input type="radio" name="Accomodation" value="Tent" id="Accomodation_0" />
          Tent</label>
        <br />
        <label>
          <input type="radio" name="Accomodation" value="Shakedown on the floor" id="Accomodation_1" />
          Shakedown on the floor</label>
        <br />
        <label>
          <input type="radio" name="Accomodation" value="Camping" id="Accomodation_2" />
          Camping</label>
        <br />
        <label>
          <input type="radio" name="Accomodation" value="Hotel" id="Accomodation_3" />
          Hotel</label>
        <br />
        <label>
          <input type="radio" name="Accomodation" value="Don't need a overnight stop" id="Accomodation_4" />
          
          Don't need a overnight stop</label>
<br /><% dmxval1.GenerateError "form1","Accomodation","allformats",",," %>
      </p></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="Submit" id="Submit" value="Submit" />
      </label></td>
    </tr>
  </table>
</form>
<p>&nbsp;</p>
</body>
</html>


Kind regards, Patrick
Replied 16 Aug 2009 14:06:06
16 Aug 2009 14:06:06 Patrick Julicher replied:
Rune,

Here is the ZIP file: www.codetogether.com/rune.zip
File will be deleted again within 5 days.

Kind regards, Patrick
Replied 16 Aug 2009 18:26:50
16 Aug 2009 18:26:50 Rune Brynestad replied:
Still incomprehensible. I have compared your code and mine. It looks the same. I can easy load your code into the extension, modify any custom error message, save it and use the new error message. When I try to do the same with my code the modifyed custom error message it's not replacing the standard error message.

Does anybody have a suggestion worth trying before I give up?

Thanks again for your patient.

Regards
Rune
Replied 17 Aug 2009 08:21:31
17 Aug 2009 08:21:31 Patrick Julicher replied:
Hi Rune,

Maybe it's not in the code of the page itself, but in the files in the Scriptlibrary. Did you compare those?

Kind regards, Patrick
Replied 17 Aug 2009 09:12:41
17 Aug 2009 09:12:41 Rune Brynestad replied:
Yes, file by file.
Replied 17 Aug 2009 13:55:39
17 Aug 2009 13:55:39 Rune Brynestad replied:
Hi again Patrick

Looked into it once again today, not so tierd and with fresh eyes. There is a vital difference between our files. The placement of the "dmxval1.GenerateJavascriptAndCss" line. In your code the line is placed over the scriptlibrary files like this

<%
' dmxValidatorJSStart
dmxval1.GenerateJavascriptAndCss
' dmxValidatorJSEnd
%>
<script src="ScriptLibrary/jsvat.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.min.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.inputHintBox.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.validate.min.js" type="text/javascript"></script>
<script src="ScriptLibrary/dmx.jquery.validate.js" type="text/javascript"></script>

In my code the line is placed under the scriptlibrary files like this.


<script src="ScriptLibrary/jsvat.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.min.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.inputHintBox.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.validate.min.js" type="text/javascript"></script>
<script src="ScriptLibrary/dmx.jquery.validate.js" type="text/javascript"></script>
<%
' dmxValidatorJSStart
dmxval1.GenerateJavascriptAndCss
' dmxValidatorJSEnd
%>

When I move the asp code block over the scriptlibrary files it works for me too.

In my case, when I apply the Universal Form Validator server behavior the "dmxval1.GenerateJavascriptAndCss" line is always placed under the scriptlibrary files and I have to move it manually. Something to be aware of in the next dot release.

Thanks again for helping me.

Regards
Rune
Replied 17 Aug 2009 17:22:43
17 Aug 2009 17:22:43 Patrick Julicher replied:
Rune,

Glad to help. Thanks for noticing and letting us know. It has been reported to the developers.

Kind regards, Patrick

Reply to this topic