Hi richiep thanx for the reply and posting that as a ticket. I somehow managed to hack it. I have the given the entire case with the code i added. Hope it helps the community,
case 'selectList':
{
$data=RSgetComponentProperties($componentId);
if($data['MULTIPLE']=='YES') $out.=\"<select multiple name=\\"form[$data[NAME]][]\\" size=\\"$data[SIZE]\\" id=\\"$data[NAME]\\" $data[ADDITIONALATTRIBUTES]>\";
else $out.=\"<select size=\\"$data[SIZE]\\" name =\\"form[$data[NAME]][]\\" id=\\"$data[NAME]\\" $data[ADDITIONALATTRIBUTES]>\";
$aux = RSisCode($data['ITEMS']);
$aux=str_replace(\"\r\",\"\",$aux);
$items=explode(\"\n\",$aux);
foreach($items as $item)
{
$item = stripslashes($item);
$buf=explode(\"|\",$item);
if(count($buf)==1)
{
if(empty($value))
//echo $value;
//print_r($value);
if(preg_match('/\[c\]/',$buf[0]))
{
//echo $value;
$out.='<option selected=\"selected\" value=\"'.$buf[0].'\">'.str_replace('[c]','',$buf[0]).\"</option>\";
}
else
{
$out.='<option value=\"'.$buf[0].'\">'.$buf[0].'</option>';
}
else if(!empty($value[$data['NAME']]))
if(array_search(str_replace('[c]','',$buf[0]),$value[$data['NAME']])!==false)
{
$out.='<option selected=\"selected\" value=\"'.$buf[0].'\">'.str_replace('[c]','',$buf[0]).\"</option>\";
}
else
{
/*custmisation starts by madhan for retaining the selected value applies only to\"[c]\"*/
if($buf[0]==$value[state][0])
{
$out.='<option selected=\"selected\" value=\"'.$buf[0].'\">'.str_replace('[c]','',$buf[0]).\"</option>\";
}
else
{
$out.='<option value=\"'.$buf[0].'\">'.str_replace('[c]','',$buf[0]).\"</option>\";
}
/*custmisation ends by madhan for retaining the selected value applies only to\"[c]\"*/
}
else
$out.='<option value=\"'.$buf[0].'\">'.str_replace('[c]','',$buf[0]).\"</option>\";
}
if(count($buf)==2)
{
if(empty($value))
if(preg_match('/\[c\]/',$buf[1]))
$out.=\"<option selected=\\"selected\\" value=\\"$buf[0]\\">\".str_replace('[c]','',$buf[1]).\"</option>\";
else
$out.=\"<option value=\\"$buf[0]\\">$buf[1]</option>\";
else if(!empty($value[$data['NAME']]))
if(array_search(str_replace('[c]','',$buf[0]),$value[$data['NAME']])!==false)
$out.=\"<option selected=\\"selected\\" value=\\"$buf[0]\\">\".str_replace('[c]','',$buf[1]).\"</option>\";
else
$out.=\"<option value=\\"$buf[0]\\">\".str_replace('[c]','',$buf[1]).\"</option>\";
else
$out.=\"<option value=\\"$buf[0]\\">\".str_replace('[c]','',$buf[1]).\"</option>\";
}
}
$out.='</select>';
}break;
Thanx again for the initiative.
\madhan