/************************************************************************\
 *									*
 *	Form.js								*
 *									*
 *	Author:	   Simon Brooke						*
 *	Created:   29th July 1999					*
 *	$Revision: 1.1.16.1 $; $Date: 2005/12/23 10:48:34 $			*
 *									*
\***********************************************************************/

/** Basic JavaScript client-end functionality. On submit, check whether
 *  any of my widgets have registered submit handlers.
 *
 *  This revision: $Author: simon $
 *  <pre>
 *  $Log: Form.js,v $
 *  Revision 1.1.16.1  2005/12/23 10:48:34  simon
 *  Brute force tidy up after CVS server crash: this time it should work.
 *
 *  Revision 1.1  1999/08/15 17:09:42  simon
 *  Major changes, primarily to htform: the action despatcher has now
 *  been built in Form, supported by a new class ActionWidget. This of
 *  course has required changes in classes built on Form, and
 *  particularly in AuthenticatedForm and TableWrapperForm, which are
 *  both now much simpler and cleaner.
 *
 *  JavaScript support has been added for more widgets.
 *
 *
 *  </pre> 
 */

/** on submitting the form, check whether any widgets need special
 *  handling and if so what special handling they need */
function invokeSubmitHandlers( form)
{
    val = true;

    for ( i = 0; i < form.elements.length; i++)
	{
	    widget = form.elements[ i];

	    if ( typeof( widget.submitHandler) == "function")
		{
		    widget.submitHandler();
				// invoke the submit handler
		    widget.submitHandler = null;
				// prevent it being called again
		}
	}

    return val;
} 

/* [end of file] */

