Hi my j query code is not working.
My View
@Html.LabelFor(model => model.POVisit, new { @class = "control- label",id="POVisit" })
@Html.DropDownList("POVisitID", "Select")
@Html.LabelFor(model => model.OrderReceived, new { @class = "control-label" })
@Html.RadioButton("OrderReceived", 1) Yes
@Html.RadioButton("OrderReceived", 0) No
My jquery code
$(document).ready(function () {
$("#OrderReceivedYesNo").hide();
});
$(document).ready(function () {
$("#POVisit").on('change', function () {
if (this.value == "Order")
{
$("#OrderReceivedYesNo").show();
}
});
});
The above code is not working. The POVisit Dropdown have 7 values which is directly fetch from Database. Initially i hide the OrderReceived radio buttons. If i select the "Order" value in POVisit DropDown it needs to show the "OrderReceivedYesNo" div. But the above code that show code is not working.
And my DateTimePicker is also not working.
jquery-ui.css">
$(document).ready(function () {
$("#Date").datepicker({
maxDate: "+0D",
changeMonth: true,
changeYear: true,
yearRange: "-100:+0",
dateFormat: "M/dd/yy",
});
})
@Html.LabelFor(model => model.Date , new { @class = "control-label" })
@* @Html.TextBoxFor(model => model.Date, new { @class = "form-control", type = "text", id="Date" })*@
Valid order date required (ex. MM-dd-yyyy)
it shows the "Date" format in view but if i select the date and trying to save the date in Db it doesn't save the date in DB .The date column is null and value is null. please any one give me the suggestion and solution to my problem..
Advance Thanks
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 30, 2016, 12:51 AM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 29, 2016, 9:56 PM EST
$(document).ready(function () {
$("#POVisit").on('change', function () {
if ($(this).val()== "Order")
{
$("#OrderReceivedYesNo").show();
}
});
});
If it helps you select it as correct answer
Sneha KRank #2,496 · 563 reputationPosted Jan 29, 2016, 10:43 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 29, 2016, 10:57 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 29, 2016, 10:58 PM EST
Sneha KRank #2,496 · 563 reputationPosted Jan 29, 2016, 11:37 PM EST
Sneha KRank #2,496 · 563 reputationPosted Jan 30, 2016, 12:26 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts