MVC Javascript Validation Framework!!

Oscar Brito


To validate manually a form:
var validationForm = Sys.Mvc.FormContext.getValidationForForm(document.forms[0]);
var valResults = validationForm.validate();
----

valResults is of type Sys_Mvc_FormContext

Sys_Mvc_FormContext from chome Inspector:

  1. Sys.Mvc.FormContext.getValidationForForm(document.forms[0])Sys_Mvc_FormContext
    1. _errorsArray[0]
    2. _formElementHTMLFormElement
    3. _onClickHandlerfunction (){return b.apply(a,arguments)}
    4. _onSubmitHandlerfunction (){return b.apply(a,arguments)}
    5. _submitButtonClickednull
    6. _validationSummaryElementnull
    7. fieldsArray[6]
    8. replaceValidationSummaryfalse
    9. __proto__Sys_Mvc_FormContext
      1. _displayErrorfunction Sys_Mvc_FormContext$_displayError() {
      2. _displaySuccessfunction Sys_Mvc_FormContext$_displaySuccess() {
      3. _findSubmitButtonfunction Sys_Mvc_FormContext$_findSubmitButton(element) {
      4. _formElementnull
      5. _form_OnClickfunction Sys_Mvc_FormContext$_form_OnClick(e) {
      6. _form_OnSubmitfunction Sys_Mvc_FormContext$_form_OnSubmit(e) {
      7. _onClickHandlernull
      8. _onErrorCountChangedfunction Sys_Mvc_FormContext$_onErrorCountChanged() {
      9. _onSubmitHandlernull
      10. _submitButtonClickednull
      11. _validationSummaryElementnull
      12. _validationSummaryULElementnull
      13. addErrorfunction Sys_Mvc_FormContext$addError(message) {
      14. addErrorsfunction Sys_Mvc_FormContext$addErrors(messages) {
      15. clearErrorsfunction Sys_Mvc_FormContext$clearErrors() {
      16. constructorfunction Sys_Mvc_FormContext(formElement, validationSummaryElement) {
      17. enableDynamicValidationfunction Sys_Mvc_FormContext$enableDynamicValidation() {
      18. replaceValidationSummaryfalse
      19. validatefunction Sys_Mvc_FormContext$validate(eventName) {
      20. __proto__Object





Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.

Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.
Feel free to contact divhide.