Validator code loaded on page

Discussion in 'ASP .Net' started by tshad, Aug 28, 2007.

  1. tshad

    tshad Guest

    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
    tshad, Aug 28, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,306
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. Kylin
    Replies:
    1
    Views:
    374
  3. Udo Corban
    Replies:
    0
    Views:
    3,820
    Udo Corban
    Jan 23, 2004
  4. Replies:
    4
    Views:
    884
    Richter~9.6
    Feb 13, 2007
  5. jianhua
    Replies:
    12
    Views:
    265
    Thomas 'PointedEars' Lahn
    Jul 2, 2011
Loading...

Share This Page