Hi,
Here is the working code you can make use of
HTML Part:
<input type="text" id="txtLoginType"/>
<select id="ddlloginType" onchange="return validate();">
<option>Select</option>
<option>lecturer</option>
<option>student</option>
</select>
Javascript Part:
function validate()
{
var content = document.getElementById('txtLoginType');
var dropdownType = document.getElementById('ddlloginType');
if (content.value == dropdownType.options[dropdownType.selectedIndex].value)
{
alert('Valid');
}
else
{
alert('Invalid');
}
}
Hope this helps you a bit.
Regards,
RK