Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Validator code loaded on page

Reply
Thread Tools

Validator code loaded on page

 
 
tshad
Guest
Posts: n/a
 
      08-28-2007
When you use Validators, it increases the size of the page and adds the
following code to your page:

<script language="javascript" type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" &&
clientInformation.appName.indexOf("Explorer") != -1) {
if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer
== "125"))
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
return true;
}
// -->
</script>

But some sites just refer to a .js file and the code is not added to the
page, but the code is working as client side code.

For example, DW has objects they call Sprys that do things such as
validations for various object such as textboxes and will shade the textbox
to grey when entering the object then change the object to red on leaving as
well as putting error messages if possible. All of this is happening on the
client page.

The only thing that seems to be getting added is something like:

<script src="../SpryAssets/SpryValidationTextField.js"
type="text/javascript"></script>
<script src="../SpryAssets/SpryValidationTextarea.js"
type="text/javascript"></script>
<script src="../SpryAssets/SpryValidationSelect.js"
type="text/javascript"></script>

<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1",
"none", {validateOn:["blur", "change"]});
var sprytextarea2 = new Spry.Widget.ValidationTextarea("sprytextarea2",
{validateOn:["blur", "change"], counterId:"countsprytextarea2",
minChars:150, var spryselect5 = new
Spry.Widget.ValidationSelect("spryselect5", {isRequired:false,
validateOn:["blur", "change"]});
//-->
</script>

But there is no code to execute and you can't see what it is doing.

If I add anthem (ajax) to my pages it adds a ton of code to the page.

Why is it that Spry doesn't add the code to the page? I would like to build
my javascript into a .js file that doesn't load on the page (just refer to
it).

Thanks,

Tom


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Review: Ajax function with javascript on loaded page enabled jianhua Javascript 12 07-02-2011 02:47 PM
Struts Validator - creditCard validator smrimell@gmail.com Java 4 02-13-2007 08:32 PM
How to get the times which between page begin be loaded and page has been load !? Kylin ASP .Net 1 05-16-2005 01:05 PM
java -verbose doesn't show "loaded from" for classes loaded from custom jars in the classpath Udo Corban Java 0 01-23-2004 09:32 AM
Re: how to programatically give assembly loaded from network the same trust as those loaded from local host? Marcelo Birnbach [MS] ASP .Net 0 06-27-2003 11:51 PM



Advertisments