使用验证控件和jquery.jqtransform无法正常工作 [英] Using Validation controls and jquery.jqtransform not working

查看:155
本文介绍了使用验证控件和jquery.jqtransform无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我对样式知之甚少.就是说,我正在和使用"jquery.jqtransform.js"的设计师一起工作.这样可以得到很多漂亮的图片(我想这不是一件坏事).但是目前在我建立的表单上,我有一些非常自定义的验证控件类.当我在同一页面上同时拥有jquery和validation时,每个控件都将进行验证(有一个大的对齐问题,但又有一个不同的问题),但没有页面验证(该页面仅提交了).

我删除了自定义验证,并使用MS验证控件无济于事.任何人都经历过吗?有什么想法吗?

预先感谢,

Eric

First off I know very little about styles. That said I''m working with a designer who uses "jquery.jqtransform.js". This allows a lot of pretty pictures (not a bad thing I guess). But currently on the form I building I have some very customized validation control class. When I have both the jquery and validation on the same page each control validates (there is a big alignment issue, but that a different concern) but no page validation (the page simple submits).

I removed the custom validation and used MS validation controls to no avail. Anyone experience this? Any thoughts?

Thanks in advance,

Eric

推荐答案

In your ajax return function (on the html page) you need to reapply the jquery commands you run the first time the page loads.

jQuery runs over the DOM and does what you tell it to. When the ajax call returns and replaces a part of the page, all runtime changes for that region are lost, so you need to reapply them.

Basically you need to call whatever function is called in jqtransform.js and in functions.js on page load on the html element which is replaces.


抱歉,延迟.我在其他项目上真的很忙.以下是页面上的一些代码段.验证是其他人编写的自定义控件,但是即使我使用Microsoft的内置验证,也会遇到相同的问题.这不是页面本身,而是另一个MVC页面上的.ascx控件.因此,有许多脚本同时运行.

一开始的注释部分是令人讨厌的.js代码.带有注释后,此验证可以正常工作,并阻止页面发布.如果我取消注释脚本,则会得到一个带有图形的漂亮页面,但没有验证.后面的代码仅填充控件并发布数据.

Sorry for the delay. I''ve been really busy on other projects. Below are some code snippet from the page. The Validation is a custom control written by someone else, but even if I use Microsoft''s built-in validation I get the same issue. This is not a page per-se but an .ascx control on another MVC page. So there is a lot of scripts running at the same time.

The commented section at the start is the offending .js code. With it commented out like this validation works normally and prevents the page from posting. If I un-comment the script I get a beautiful page with graphics but no validation. The code-behind only populate controls and post the data.

<%--    <script type="text/javascript" src="/content/XXX/js/forms/jquery.jqtransform.js" ></script>
    <script type="text/javascript" language="javascript">


(function(){
(function() {


这篇关于使用验证控件和jquery.jqtransform无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆