Here is my issue:
I have 4 different checkboxes and 4 different labels each (checkbox + label) is showing up on tab. I have 4 tabs, I want to create a function in JavaScript that once the user clicked on one of the checkboxes it will read from an hidden field the value and going to set it up in each of the labels across all tabs and check all the other checkboxes
For instance:
First scenario (Tab 1): If the user click on the checkbox it will read the hidden field and it going to set the hidden field value in the labels across all tabs and check all the other checkboxes
Second scenario (Tab 3): If the user unchecked the checkbox in the third tab it's going to clear the values from all other labels and uncheck all the other checkboxes.
Please help!
JS Function:
function ValidationSectionComplete(sender, args) {
var sectionCompleteGeneralInfo = $find("<%= btnSectionCompleteGeneralInfo.ClientID %>");
var sectionCompleteDetailsInfo = $find("<%= btnSectionCompletedDetials.ClientID %>");
var sectionCompleteMedicalInfo = $find("<%= btnSectionCompletedMedical.ClientID %>");
var sectionCompleteNarrativeInfo = $find("<%= btnNarrativeComplete.ClientID %>");
//Get the logged in full name when the page is load.
var loggedInFullName = document.getElementById("<%= hfLoggedInFullName.ClientID %>").value;
var insertedByGeneralInfo = document.getElementById("<%=lblByGeneralInfo.ClientID %>");
var insertedByDetailsInfo = document.getElementById("<%=lblByDetails.ClientID %>");
var insertedByMedicalInfo = document.getElementById("<%=lblByMedicalInfo.ClientID %>");
var insertedByNarrativeInfo = document.getElementById("<%=lblByNarrative.ClientID %>");
if ((sectionCompleteGeneralInfo.get_checked() == true) && (sectionCompleteDetailsInfo.get_checked() == true) && (sectionCompleteMedicalInfo.get_checked() == true) && (sectionCompleteNarrativeInfo.get_checked() == true)) {
insertedByGeneralInfo.innerHTML = loggedInFullName;
insertedByDetailsInfo.innerHTML = loggedInFullName;
insertedByMedicalInfo.innerHTML = loggedInFullName;
insertedByNarrativeInfo.innerHTML = loggedInFullName;
}
else {
insertedByGeneralInfo.innerHTML = "";
insertedByDetailsInfo.innerHTML = "";
insertedByMedicalInfo.innerHTML = "";
insertedByNarrativeInfo.innerHTML = "";
}
}
Aucun commentaire:
Enregistrer un commentaire