Hello,
I was able to access the value of the drop down using the following line of code inside the for loop:
var dropdown_value = data[i]["value"];
To achieve my validation requirements, I added a global boolean variable g_bln_validValue and used it as a flagging value. If the flag is true, then the value is present in the drop down list. I then check the value if the flag in my function loadPageData. The modified code is as follows:
g_bln_validValue = false; //added at the top in my html page code
$.extend($.fn.validatebox.defaults.rules,{
inList:{
validator:function(value,param){
var c = $(param[0]); //param[0] = field id
var opts = c.combobox('options');
var data = c.combobox('getData');
var exists = false;
for(var i=0; i<data.length; i++)
{
//if (value == data[i][opts.textField])
if (value.toLowerCase() == data[i][opts.textField].toLowerCase())
{
exists = g_bln_validValue = true;
g_str_dropDownValue = data[i][opts.textField];
var dropdown_value = data[i]["value"];
//console.log("value.toLowerCase(): " + value.toLowerCase() + "\tdata[" + i + "][opts.textField].toLowerCase(): " + data[i][opts.textField].toLowerCase() + "data[" + i + "][\"value\"]: " + data[i]["value"]);
loadPageData();
break;
}
}
g_bln_validValue = exists;
return exists;
},
message:'invalid value.'
}
});
Thanks & Regards,
Darrel.