nearChepstow
Member
- Joined
- Nov 13, 2020
- Messages
- 6
- Programming Experience
- 1-3
I have two partials in one view and both are using the same model value, but both at first are set to display: none, and changed by jquery depending on the value of a dropdown.
So at any one time, one is able to be seen the other display set to none, but the first one when I submit still has an effect on the second one. So with that I mean I put a number in date, then in the controller, that is empty because there no value in the first one, so its taking that into consideration instead.
So at any one time, one is able to be seen the other display set to none, but the first one when I submit still has an effect on the second one. So with that I mean I put a number in date, then in the controller, that is empty because there no value in the first one, so its taking that into consideration instead.
C#:
<div id="choiceNumber" style="display: none;">
@Html.Partial("_FormElementPartial", new ViewDataDictionary() {
{ "Label", LH.GetText(SystemComponent.TheSystem, "lblModuleQuestionForm_NewPlaceholderNumber")},
{ "Element", Html.NumberFieldFor(model => model.PlaceHolderNumber, 999999, BL.MaximumNumberOfDecimalPlaces, formTextField: true, minValue: -999999) },
{ "Info", Html.LocalisedTooltip((Model.Id > 0 ? "ttEditModuleQuestionForm_NewPlaceholderNumber" : "ttNewModuleQuestionForm_NewPlaceholderNumber"), "lblModuleQuestionForm_NewPlaceholderText_ToolTip", SystemComponent.TheSystem) }
})
</div>
<div id="choiceDate" style="display: none;">
@Html.Partial("_FormElementPartial", new ViewDataDictionary() {
{ "Label", LH.GetText(SystemComponent.TheSystem, "lblModuleQuestionForm_NewPlaceholderDate")},
{ "Element", Html.NumberFieldFor(model => model.PlaceHolderNumber, 999999, 0, formTextField:true, minValue: -999999, htmlAttributes: new { @id = "PlaceHolderDate"}) },
{ "Info", Html.LocalisedTooltip((Model.Id > 0 ? "ttEditModuleQuestionForm_NewPlaceholderDate" : "ttNewModuleQuestionForm_NewPlaceholderDate"), "lblModuleQuestionForm_NewPlaceholderDate_ToolTip", SystemComponent.TheSystem) }
})
</div>
Last edited by a moderator: