function checkForm(formNum, val1, val2, val3) {
    var e, form = document.getElementById("form" + formNum);
    ok(form, "Locating form " + formNum);

    var numToCheck = arguments.length - 1;
    
    if (!numToCheck--)
        return;
    e = form.elements[0];
    if (val1 == null)
        is(e.value, e.defaultValue, "Test default value of field " + e.name +
            " in form " + formNum);
    else
        is(e.value, val1, "Test value of field " + e.name +
            " in form " + formNum);


    if (!numToCheck--)
        return;
    e = form.elements[1];
    if (val2 == null)
        is(e.value, e.defaultValue, "Test default value of field " + e.name +
            " in form " + formNum);
    else
        is(e.value, val2, "Test value of field " + e.name +
            " in form " + formNum);


    if (!numToCheck--)
        return;
    e = form.elements[2];
    if (val3 == null)
        is(e.value, e.defaultValue, "Test default value of field " + e.name +
            " in form " + formNum);
    else
        is(e.value, val3, "Test value of field " + e.name +
            " in form " + formNum);

}
/*
 * checkForm
 *
 * Check a form for expected values. If an argument is null, a field's
 * expected value will be the default value.
 *
 * <form id="form#">
 * checkForm(#, "foo");
 */
checkForm
Check a form for expected values. If an argument is null, a field's
expected value will be the default value.


checkForm Check a form for expected values . If an argument is null a field ' s expected value will be the default value .
function checkForm(formNum, val1, val2, val3) {
    var e, form = document.getElementById("form" + formNum);
    ok(form, "Locating form " + formNum);
    var numToCheck = arguments.length - 1;
    if (!numToCheck--)
        return;
    e = form.elements[0];
    if (val1 == null)
        is(e.value, e.defaultValue, "Test default value of field " + e.name +
            " in form " + formNum);
    else
        is(e.value, val1, "Test value of field " + e.name +
            " in form " + formNum);
    if (!numToCheck--)
        return;
    e = form.elements[1];
    if (val2 == null)
        is(e.value, e.defaultValue, "Test default value of field " + e.name +
            " in form " + formNum);
    else
        is(e.value, val2, "Test value of field " + e.name +
            " in form " + formNum);
    if (!numToCheck--)
        return;
    e = form.elements[2];
    if (val3 == null)
        is(e.value, e.defaultValue, "Test default value of field " + e.name +
            " in form " + formNum);
    else
        is(e.value, val3, "Test value of field " + e.name +
            " in form " + formNum);
}
function checkForm ( formNum , val1 , val2 , val3 ) { var e , form = document . getElementById ( "form" + formNum ) ; ok ( form , "Locating form " + formNum ) ; var numToCheck = arguments . length - 1 ; if ( ! numToCheck -- ) return ; e = form . elements [ 0 ] ; if ( val1 == null ) is ( e . value , e . defaultValue , "Test default value of field " + e . name + " in form " + formNum ) ; else is ( e . value , val1 , "Test value of field " + e . name + " in form " + formNum ) ; if ( ! numToCheck -- ) return ; e = form . elements [ 1 ] ; if ( val2 == null ) is ( e . value , e . defaultValue , "Test default value of field " + e . name + " in form " + formNum ) ; else is ( e . value , val2 , "Test value of field " + e . name + " in form " + formNum ) ; if ( ! numToCheck -- ) return ; e = form . elements [ 2 ] ; if ( val3 == null ) is ( e . value , e . defaultValue , "Test default value of field " + e . name + " in form " + formNum ) ; else is ( e . value , val3 , "Test value of field " + e . name + " in form " + formNum ) ; }
checkForm
 Check a form for expected values.
checkForm Check a form for expected values .