Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fValidate 5.01b Group Error Mode Problem..

    Greetings All.

    I'm encountering a problem with Peter Bailey's fValidate 5.01b (http://www.peterbailey.net/fValidate/)

    Statement of the Problem: onSubmit produces:

    A Runtime Error has occurred.
    Line: 518
    Error: 'undefined is null or not an object'

    Environment:

    Windows NT 4 SP6a
    MSIE 6.0 SP1
    fValidate: 5.01b (No mods to any of fValidate's files)

    To Reproduce: Create a simple two field form (or use the one at the end of this post) and enable bConfirm, bDisable,
    bDisableR and group error modes true with error notification mode of '24'
    [i.e. onSubmit="return validateForm(this,1,1,1,1,24);] Open the file and fill-in both fields with valid information
    and click "Submit".

    Instead of the expected confirmation message (bConfirm is true), I get:

    A Runtime Error has occurred.
    Line: 518
    Error: 'undefined is null or not an object'

    The referenced code is in fValidate.core.js at:

    var focusElem = ( typeof firstElem.fields != 'undefined' )?
    firstElem.fields[0]:
    firstElem;
    this.selectFocus

    If I make the change:

    From: <FORM name="fValfrm" onSubmit="return validateForm(this,1,1,1,1,24);">
    To: <FORM name="fValfrm" onSubmit="return validateForm(this,1,1,1,0,24);">

    that disables Group Error mode, the confirmation message appears as expected.

    Does anyone see any stupidity that I'm performing here and can point me in the right direction?

    Thanks!

    R. Damian Koziel


    ----------

    <HTML>
    <HEAD>
    <STYLE>
    input.errHilite, select.errHilite, textarea.errHilite {
    border: 1px solid #DDC;
    background-color: #FFE;
    }
    label.errHilite {
    color: #C00;
    }
    ul#errors {
    display: none;
    margin-top: 1em;
    background-color: #FFE;
    border: 1px solid #CC9;
    padding: .3em;
    color: #C00;
    font-weight: bold;
    }
    ul#errors li {
    margin-top: .5em;
    margin-bottom: .5em;
    padding: 0;
    }
    ul#errors li.heading {
    list-style-type: none;
    color: #000;
    font-weight: normal;
    font-style: italic;
    margin: .5em 0;
    padding: 0;
    }
    </STYLE>

    <script type="text/javascript" src="js/fValidate.config.js"></script>
    <script type="text/javascript" src="js/fValidate.core.js"></script>
    <script type="text/javascript" src="js/fValidate.lang-enUS.js"></script>
    <script type="text/javascript" src="js/fValidate.validators.js"></script>

    </HEAD>

    <BODY>
    <FORM name="fValfrm" onSubmit="return validateForm(this,1,1,1,0,24);">

    <ul id="errors">
    <li class="heading">Click the individual error message below to focus on
    the element in error.</li>
    </ul>

    Your Name: <input type=text name="name" alt="alnum|3|x|0|1|-.,&" emsg="No
    name." size="38">
    <br>
    <br>
    Your E-Mail Address: <input type=text name="from" alt="email" emsg="No
    e-mail address." size="38">
    <br><br>

    <input type="submit" value="Submit" name="Submit" />
    <input type="reset" value="Reset" name="Reset" />
    </FORM>
    </BODY>
    </HTML>

  • #2
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fvalidate Group Error Mode Problem

    Hello,

    I did the following to get it to work on IE6 (and continue working with Firefox). Not tested on other browsers. Code may be improved easily by someone else, etc.

    Find the code in the /* */ below in the fvalidate file and comment it as below and add the code found below the commented code.

    /* var focusElem = ( typeof firstElem.fields != 'undefined' )?
    firstElem.fields[0] :
    firstElem;

    this.selectFocus( focusElem );
    */
    if ( (firstElem != null) && ( typeof firstElem.fields != 'undefined' ) ) {
    alert(firstElem.fields[0]);
    var focusElem = firstElem.fields[0];
    this.selectFocus( focusElem );

    }

    if (firstElem != null) {
    this.selectFocus( firstElem );
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •