Hi
I want if value of Dropdown is Delivered then user must enter Date in Date of Delivery using Javascript
Code
Status *
Select Status
Return Dispatched
Return DeliveredThanks
Hi
I want if value of Dropdown is Delivered then user must enter Date in Date of Delivery using Javascript
Status *
Select Status
Return Dispatched
Return DeliveredThanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ramco RamcoRank #462 · 5.4K reputationPosted Oct 14, 2022, 6:20 AM EDT
Hi Jignesh
In my below code how it can be done. Data of Delivery should not be Blank if Status is Delivered
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Oct 14, 2022, 7:28 AM EDT
Hi Jignesh
If User does not enter Date then i want to display message "Invalid Date". Similar to like below
if (ddlStatus != "Delivered" && txtRemark.length < 5) {
bootbox.alert({
size: 'small',
title: 'Error!',
message: 'Please Enter Remarks'
});
valid = false;
}
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Oct 14, 2022, 7:39 AM EDT
Hi Jignesh
I am trying below code but it is not working
var theDate = document.getElementById("txtReceivedOn").value;
if (ddlStatus.val() === "Return Delivered") {
$("#txtReceivedOn").attr("required", true);
valid = false;
}
Thanks
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 14, 2022, 2:36 AM EDT
Hello Ramco,
Please test this one will work for you,
$('#ddlStatus').on('change', function() { if ($(this).val() === "Delivered") { $("#extraNamen").show(); $("#extraNamen").attr("required",true); } });Jignesh KumarRank #91 · 22.9K reputationPosted Oct 14, 2022, 7:23 AM EDT
Hello,
Please try this one,
function DoValidation(parameter) { var valid = true; var ddlStatus = document.getElementById("ddlStatus"); if (ddlStatus.val() === "Delivered") { $("#YourDateTextBox").show(); $("#YourDateTextBox").attr("required",true); valid = false; } return valid; };