Robdel12 / DropKick

A JavaScript plugin for creating beautiful, accessible, and painless custom dropdowns.

Home Page:http://dropkickjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using Validation with Dropkick

memorx opened this issue · comments

Hi, I have been using dropkick for a while, and I am loving it. Lately we need to change the way our forms work, including validation, however, I don't find any documentation about how to do it properly.

For example this is my HTML

<div class="dropdown-new-order">
  @Html.LabelFor(x => x.OnsiteEnviroment)<span class="required-field">*</span>
  @Html.DropDownListFor(x => x.OnsiteEnviroment, Model.OnsiteEnviromentDictionary.Select(z => new SelectListItem { Value = z.Key.ToString(), Text = z.Value }), "Please select of the following", new { @class = "dropkick full-field", data_width = "280", tabindex = "2", required = "required" })
</div>

I am using the required attribute to validate the dropdown, however , it doesn't acknowledge the validation, and using another validation tool has the same effect.

Do you have any recommendation? I stackoverflow I found some solutions but they haven't worked for me:

http://stackoverflow.com/questions/13145359/how-to-use-jquery-validate-on-div-based-select-form-element?rq=1

Thank you

Hmm, so it seems you need to do some client side validations with DropKick?

Closing this. Will reopen when/if more info is available :)