validation is not working on fire fox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aaaaaaaaaaa
    New Member
    • Jun 2008
    • 1

    validation is not working on fire fox

    i have used required field validaiton in validator.js,it working well on ie7 but not in
    firefox.when i click on submit in firefox it not validate the field.pls help me
    code used in validator.js is:
    [CODE=javascript] RequiredFieldVa lidator.prototy pe = new Validator();
    function RequiredFieldVa lidator(element Id,defaultMessa ge,args){
    this.elementId = elementId;
    this.args = new Array();
    this.defaultMes sage = defaultMessage;
    this.messageKey = "required_field _message";
    this.validateMe = function(elemen tObj){
    var myValue = getValueOfEleme nt(elementObj);
    var retValue = true;
    if(myValue == null){
    return false;
    }if(myValue.con structor == Boolean){
    if(myValue === false)
    retValue = false;
    }else if(myValue.cons tructor === Array){
    if(myValue == null || myValue.length < 1)
    retValue = false;
    }else{
    myValue = trim(myValue);
    if(myValue == null || myValue == "")
    retValue = false;
    }
    return retValue;
    }
    this.setArgs(Re quiredFieldVali dator.arguments );
    }[/CODE]
    Last edited by acoder; Jun 26 '08, 10:43 AM. Reason: Added [code] tags
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Is this JavaScript?

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Yes it is.

      ax11, please use code tags when posting code. It makes it easier to read. Thanks!
      Can you show how this validator is used? The calls made and how is getValueOfEleme nt defined?

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by acoder
        Yes it is.
        Ok, the 'getValueOfElem ent' confused me.

        Comment

        Working...