Form Validation Help with frmvalidator on clearing validation

Discussion in 'JavaScript' started by olopsman, Jan 24, 2010.

  1. #1
    hi need some help from the javascript experts. I have a page that I use drop down list to show and hide parts of a form, depending on option selected a new field either, text, radio or another drop down list is displayed/hidden.

    Im using the javascript code from for my validation.

    http://www.javascript-coder.com/html-form/javascript-form-validation.phtml

    There is a default clear all function and I created my custom clear validation function based on that for removing only specific previously validated fields.

    function clear_all_validations()
    {
    for(var itr=0;itr < this.formobj.elements.length;itr++)
    {
    this.formobj.elements[itr].validationset = null;
    }
    }
    //custom clear
    function clear_validation(itemname)
    {
    this.formobj.elements[itemname].validationset = null;

    }

    The function though only works with text boxes, it does not work with radio or drop down list previously validated that I wanted to clear.

    It returns.

    Message: 'this.itemname.elements' is null or not an object
    Line: 75
    Char: 2
    Code: 0

    Hope I was clear in my explanation. Any feedback is appreciated to point me to the right direction.
     
    olopsman, Jan 24, 2010 IP