weareoutman / clockpicker

A clock-style timepicker for Bootstrap (or jQuery). Sorry but no longer maintained.
http://weareoutman.github.io/clockpicker/
MIT License
1.99k stars 536 forks source link

When using two clockPicker in the same form, the second one does not function! #66

Open ghost opened 8 years ago

ghost commented 8 years ago

I'm a newbie and using this in an MVC project. In a "Create" view I have used two fields as clockPicker (start and end time). First one works like a charm but the second one does not function. I do not know if this is the right place to bring this up. Here's my code in Create view:

@Html.EditorFor(model => model.StringStartTime, new { htmlAttributes = new { @class = "form-control clockPicker", id = "single-input", value = "", placeholder = "اکنون" } })

@Html.EditorFor(model => model.StringEndTime, new { htmlAttributes = new { @class = "form-control clockPicker", id = "single-input", value = "", placeholder = "اکنون" } })

ghost commented 8 years ago

I solved it by giving the EndTime a different id.

RokSiEu commented 8 years ago

Instead of binding clockpicker to ID bind it to element class and use $('.clockpicker').clockpicker();

joecorsi commented 8 years ago

I am also having an issue with this. I am binding the clockpicker to the element class as previously mentioned but cannot get the second clockpicker to function as needed. Can someone elaborate on this?

PhiLhoSoft commented 7 years ago

See also #48