Orchard custom forms with unobtrusive client-side validation -
i'm using orchard's 'custom forms' module build form adding bunch of fields content type called 'booking form'. works fine - can submit form , view submissions in admin pages.
i want use client-side validation on fields. i've succeeded in getting jquery unobtrusive validation work on own manually-built forms (using @html.editorfor() property on viewmodel, , decorating field [required]). however, can't work in context.
i guessing because property that's being used render input not decorated dataannotations attributes:
namespace orchard.core.common.viewmodels { public class textfielddriverviewmodel { public textfield field { get; set; } public string text { get; set; } public textfieldsettings settings { get; set; } } } i think 'text' field need [required] before unobtrusive validation work properly.
is there way achieve unobtrusive validation fields this? decorating property undesirable, fields not marked required in cms become required.
Comments
Post a Comment