asp.net mvc - MVC client validation causing false errors -


I'm hoping someone has run something like that. A text input text is triggered client side [required] error message

I have the following included in the master:.

  & lt; Script src = "/ script / jquery-1.4.1.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "/ script / jquery-1.4.1-vsdoc.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "/ script / MicrosoftAjax.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "/ script / microsoft mvcackex.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "/ script / MicrosoftMvcAjax.debug.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "/ script / MicrosoftMvcValidation.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "/ script / jquery.validate.js" type = "text / javascript" & gt; & Lt; / Script & gt;  

as well as

    

There are some possible factors:

  • form coming from a partial view
  • presents text CKEditor
  • CKEditor is hidden on page load and then detected via jQuery

    I'm just not sure what this could be causing.

    Form:

      & lt; & Lt; Form action = id = "form0" method = "post" & gt "/ quotation / / create 1" div class = "validity-summary-valid" id = "verification" summary "" gt; & Lt; Ul & gt; & Lt; Li style = "display: none" & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Fieldset & gt; & Lt; Story & gt; Fields & lt; / Narrative & gt; & Lt; Div class = "editor-field" & gt; & Lt; Input id = "quote id" name = "quotation id" type = "hidden" value = "0" /> & Lt; / Div & gt; & Lt; Div class = "editor-field" & gt; & Lt; Input id = "UserID" name = "UserID" type = "hidden" value = "54cb0fde-649d-429c-8800-6bd9cc286d90" /> & Lt; / Div & gt; & Lt; Div class = "editor-label" & gt; & Lt; Label = "page number" & gt; Page number & lt; / Label & gt; & Lt; / Div & gt; & Lt; Div class = "editor-field" & gt; & Lt; Input id = "page number" name = "page number" type = "text" value = "" /> & Lt; Span class = "field-validation-valid" id = "PageNumber_validationMessage" & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "editor-label" & gt; & Lt; Label = "quotation text" & gt; Coat Text & lt; / Labels & gt; & Lt; / Div & gt; & Lt; Div class = "editor-field" & gt; & Lt; Textarea cols = "20" id = "quotText" name = "quotation text" rows = "2" & gt; & Lt; / Text field & gt; & Lt; Span class = "field-validation-valid" id = "quotText_validationMessage" & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "editor-field" & gt; & Lt; Input id = "BookID" name = "BookID" type = "hidden" value = "1" /> & Lt; / Div & gt; & Lt; Div class = "editor-field" & gt; & Lt; Input id = "datecreated" name = "datecreated" type = "hidden" value = "7/28/2010 9:21:36 PM" /> & lt; / Div & gt; & Lt; P & gt; & Lt; Input ID = "submit quote" type = "submit" value = "create" /> & Lt; / P & gt; & Lt; / Fieldset & gt; & Lt; / Form & gt; & Lt; Script type = "text / javascript" & gt; // & lt ;! [CDATA [if (! Window.mvcClientValidationMetadata) {window.mvcClientValidationMetadata = []; } Window.mvcClientValidationMetadata.push ({ "Fields": [{ "FIELDNAME": "PageNumber", "ReplaceValidationMessageContents": true, "ValidationMessageId": "PageNumber_validationMessage", "ValidationRules": [{ "Error": "field PageNumber "Validation parameters": {}, "Validation type": "No."}]}, { "Field": "extract text", "insert replacement validity message": true, "Validation message": "quote text" Validation Message "," Validation Rule "" Error Message ":" This quote is too long. "," Validation Parameter ": {" Minimum Length ": 0," Maximum Length ": 500}," Validation Type ":" stringLength "}, {" message ":" "Formid": "Form 0", "Change Wanikrn Summary": false, "Manykrnsutraidi" You did not enter a quote "" "Validation parameters": {}, "Validation type": "necessary"}]}}] "ValidationSummary"}); //]] & gt; & Lt; / script & gt;  

    I

      & lt;% Html removes am. enable client validation (to); & Gt%;  

    the server-side validation OK Works and does not generate any errors.

    I figured out

    click on $ ('# quoteSubmit') (Function () {CKEDITOR.instances ['QuoteText'] updateElement ();.));!

    Yeehaw.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -