How to get colon separated values in Javascript from Check Box
615441Jul 8 2009 — edited Jul 9 2009Hi,
I want to get values of a Check Box item as a colon separted form as what we get in Database. For example "10:11:12".
When I tried to write a code like this it doesn't work. Please tell me where I am going wrong.
function getValues(pcheckbox) {
cb_name = html_GetElement(pcheckbox+'_0').name;
cb_array = document.getElementByName(cb_name);
var val_str =':';
for (i=0; i<cb_array.length; i++ )
{
if (cb_array.checked)
{
val_str += cb_array[i].value + ':';
}
}
html_GetElement(P206_TEXT).value = val_str;
}
I am trying to call the function by getValues('P206_CHECK');
Thanks & Regards,
Vikas Krishna