Closed sgentile closed 10 years ago
It appears to work correctly if I make this change ?
$(selector).change();
//if ($(selector).is(':radio')) {
// $(selector + ':checked').change();
//} else {
// $(selector).change();
//}
This was fixed in the latest release (yesterday). The Javascript file now comes from Nuget. Please let me know if you still experience issue.
Looks good on radio/checkbox... it's not working on my dropdownlist/select though (works once it's changed, but on load it's not)
Please get latest. This should be fixed.
I had to add this
$(document).on('change', selector + ':not(:checkbox)', function () {
if ($(this).val().toString() == val.toString()) {
toHide.show(isFirstRun ? undefined : speed);
} else {
toHide.hide(isFirstRun ? undefined : speed);
}
});
when I have the :not(:hidden) it didn't fire on load
(not add, but replaced same line where it had hidden)
does not make sense... could you please show exactly the bmvc markup and Model that you used?
@(f.FormGroup().Class("row").CustomControls(Html.Bootstrap().Div(Html.Bootstrap().DropDownListFor(m => m.Person.RelationshipTypeName, new SelectList(Model.RelationshipType, "Name", "Name")).Label()).Xs(5)))
@(f.FormGroup().Class("row").VisibleDependsOn(model => model.Person.RelationshipTypeName, "Other").CustomControls(Html.Bootstrap().Div(Html.Bootstrap().TextBoxFor(model => model.Person.OtherRelationShip).Label()).Xs(5)))
I just tested your code. It works fine for me with the code I have. I'm going to close this issue and if someone else has issue with it as well, I'll revisit.
I'm having an issue where VisibleDepends on does not 'fire' when the page loads. After selecting, ie. a dropdown list or radiobutton list value, then it fires, but on load it isn't firing.
I am using TwitterBootstrapMvcJs-3.0.4.js