Checkin two the same values in a Combo Box in Javascript.
The main purpose of this script is to determine that the values selected is already selected on the first selection, Let say we have created a Two Combo Box that load data from MySql Database. (Auto Populate)
The Code:
function CheckSameData(){
if (document.getElementById('FirstSelection').value == document.getElementById('SecondSelection').value){
alert ("Selection is Already been Selected.");
document.getElementById('SecondSelection').focus();
document.getElementById('SecondSelection').style.color = '#FF0000'; //This will change the font color of the duplicating item.
return false;
}
return true;
}