Universal Form Validator ASP Support Product Page
Just can't get this to work
Reported 09 Feb 2010 20:04:56
1
has this problem
09 Feb 2010 20:04:56 Gareth Tannatt Nash posted:
Hi there,I've installed Universal Form Validator ASP, but just can't get it to work.
I'm trying to force validation (and Enable /disable // Show/hide form elements based on the value of a select element on the form)
I've applied this behaviour to the form, but it doesn't do any validation, it does however hide the entire DIV at times - which is really strange, my code is below -
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!--#include file="../include/AdminAccess.asp" --> <!--#include file="../Connections/recruta2.asp" --> <!--#include file="../ScriptLibrary/dmxValidator.asp" --> <!--#include file="../scripts/nonxmlformating.asp" --> <!--#include file="../scripts/sitedetails.asp" --> <!--#include file="../scripts/nonhtmlformatting.asp" --> <!--#include file="scripts/quickstatscode.asp" --> < %' IIf implementation Function MM_IIf(condition, ifTrue, ifFalse) If condition = "" Then MM_IIf = ifFalse Else MM_IIf = ifTrue End If End Function %> < %' 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 "updateaccount", "dmxCalendar_1", "allformats", ",accounttype,== m", "true", "", "", "", "" dmxval1.AddRule "updateaccount", "dmxCalendar_2", "allformats", ",accounttype,== m", "true", "", "", "2", "wrapper,show,normal" dmxval1.AddRule "updateaccount", "FreeTrial", "allformats", ",accounttype,== m", "false", "", "", "2", "wrapper,show,normal" dmxval1.Validate %> < %Dim CompanyDetail__MMColParam CompanyDetail__MMColParam = "0" If (Request.QueryString("ID") <> "") Then CompanyDetail__MMColParam = Request.QueryString("ID") End If %> < %Dim CompanyDetail__MMColParam2 CompanyDetail__MMColParam2 = "0" If (Session("SITEID") <> "") Then CompanyDetail__MMColParam2 = Session("SITEID") End If %> < %Dim CompanyDetail Dim CompanyDetail_cmd Dim CompanyDetail_numRows Set CompanyDetail_cmd = Server.CreateObject ("ADODB.Command") CompanyDetail_cmd.ActiveConnection = MM_recruta2_STRING CompanyDetail_cmd.CommandText = "SELECT JBCLID, JBCLName, JBCLAccountType, JBCLMStartDate, JBCLMEndDate, FreeTrial FROM dbo.JBClient WHERE JBCLID = ? AND JBCLSiteID = ?" CompanyDetail_cmd.Prepared = true CompanyDetail_cmd.Parameters.Append CompanyDetail_cmd.CreateParameter("param1", 5, 1, -1, CompanyDetail__MMColParam) ' adDouble CompanyDetail_cmd.Parameters.Append CompanyDetail_cmd.CreateParameter("param2", 5, 1, -1, CompanyDetail__MMColParam2) ' adDouble Set CompanyDetail = CompanyDetail_cmd.Execute CompanyDetail_numRows = 0 %> <% If CompanyDetail.EOF Then Response.Redirect("default.asp") End if%> <!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>Webmaster Home</title> <meta name="Robots" content="noindex,nofollow" /> <meta http-equiv="author" content="Recruta" /> <meta http-equiv="Refresh" content="1199;URL=../scripts/logout.asp?us=wm" /> <link href="../Styles/Layout/main_layout.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/topbar.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/footer.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/advertisenow.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/Google_Adverts.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/leftjobseekerbuttons.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/leftclientbuttons.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Layout/homepagetext.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/webmaster/webmastersections.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/webmaster/jobs.css" rel="stylesheet" type="text/css" media="all" /> <link href="../Styles/Errors/error.css" rel="stylesheet" type="text/css" media="all" /> <link rel="stylesheet" type="text/css" href="../Styles/dmxCalendar/dmxCalendar.css" /> <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> <script language="javascript" type="text/javascript" src="../ScriptLibrary/jquery-latest.pack.js"></script> <script language="javascript" type="text/javascript" src="../ScriptLibrary/dmxCalendar/dmxCalendar.js"></script> <% ' dmxValidatorJSStart dmxval1.GenerateJavascriptAndCss ' dmxValidatorJSEnd %> </head> <body> <div id="wrapper"> <div id="maincenter"> <div id="topbar"> <div id="verytop"> <div class="logoarea"><img src="../VarImages/logo.png" alt="Jobs in brought to you by 's leading recruitment job search site" width="224" height="46" /></div> <div class="afterlogoarea"> <p> </p> </div> <div class="topbanner"> </div> </div> <div id="topnavbar"> <!--#include file="include/topnav.asp" --> <div class="topnavbarright"> <ul> <li><a href="#">Log Out</a></li> </ul> </div></div> </div> <div id="backmain"> <div class="mainholder"> <div id="left_column"> <!--#include file="include/leftnav.asp" --> <!--#include file="include/reportnav.asp" --> </div> <div id="main_column"> <div class="section1"> <h1>Company Detail Update - <%=(CompanyDetail.Fields.Item("JBCLName").Value)%></h1> </div> <div class="homepagetextregion"> <div class="toapply2"> <p>Use the form below to make any changes to this account<strong></strong>. Please note that Free Trial should only be selected fot Fixed Term Contract Accounts, as should Start Date & End Date Values.</p> </div> </div> <div class="section1"> <form action="<%=DMX_validateAction%>" method="post" name="updateaccount" id="updateaccount" onSubmit="return validateupdateaccount(this)"> <fieldset> <h3>Account Detail</h3> <ul> <li> <label>Account Type <span class="redx">*</span>: </label> <select name="accounttype" id="accounttype"> <option value="m" <%If (Not isNull((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then If ("m" = CStr((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Fixed Term Contract</option> <option value="a" <%If (Not isNull((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then If ("a" = CStr((CompanyDetail.Fields.Item("JBCLAccountType").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Pay as You Go</option> </select> </li> <li> <label>Start Date <span class="redx">*</span>: </label> <input type="text" id="dmxCalendar_1" name="dmxCalendar_1" readonly="readonly" /> <script type="text/javascript"> // <![CDATA[ $(function() {$('#dmxCalendar_1').datepicker({ skin : "dmxCalendar", dateFormat : "M d, yy", showStatus : true, numberOfMonths : [1,1], showAnim : "fadeIn", showOptions : { easing : "easeOutBounce", direction : "up" }, duration : "normal", showOn : "both", buttonImage : "../Styles/dmxCalendar/calendar_icon.gif", buttonImageOnly : true, prompt : "" });}) // ]]> </script> </li><li> <label>End Date <span class="redx">*</span>: </label> <input type="text" id="dmxCalendar_2" name="dmxCalendar_2" readonly="readonly" /> <script type="text/javascript"> // <![CDATA[ $(function() {$('#dmxCalendar_2').datepicker({ skin : "dmxCalendar", dateFormat : "M d, yy", showStatus : true, numberOfMonths : [1,1], showAnim : "fadeIn", showOptions : { easing : "easeOutBounce", direction : "up" }, duration : "normal", showOn : "both", buttonImage : "../Styles/dmxCalendar/calendar_icon.gif", buttonImageOnly : true, prompt : "" });}) // ]]> </script> </li><li> <label>Free Trial: </label> <input name="FreeTrial" type="checkbox" id="FreeTrial" value="Y" /> <% dmxval1.GenerateError "updateaccount","FreeTrial","allformats",",accounttype,== m" %> </li> <li> <label></label> <input type="submit" name="update" id="update" value="UPDATE" /> </li> </ul> </fieldset> </form> </div> </div> <div id="right_column"> <!--#include file="include/quickstats.asp" --> </div> </div> </div> </div> </div> <div id="wrapper_Foot"> <!--#include file="include/footer.asp" --> </div> </body> </html> < %CompanyDetail.Close() Set CompanyDetail = Nothing %>
Appreciate any help with this, as so far I haven't had any success with this extension at all....
Thank you
Replies
Replied 10 Feb 2010 10:14:12
10 Feb 2010 10:14:12 Miroslav Zografski replied:
Hello Gareth,
I was wondering if you can provide a live link to the page in question. Also, please, assure that all required files are uploaded and are accessible through the paths assigned in the head tag.
If you cannot provide such a link, please, check the generated javascript and css right placed right before the closing head tag of your page.
Regards,
I was wondering if you can provide a live link to the page in question. Also, please, assure that all required files are uploaded and are accessible through the paths assigned in the head tag.
If you cannot provide such a link, please, check the generated javascript and css right placed right before the closing head tag of your page.
Regards,