sorry guys, i searched for this and couldn’t make it work. i wrote this code in PHP, and now i need to do the same thing in JavaScript. basically, it searches a string to see if another string exist, and sets a varaible according to the result.
in PHP:
if(!strstr($ins, ‘IEHP’) && !strstr($ins, ‘Private’) && !strstr($ins, ‘Workers’)){
if(strstr($ins, ‘Medicare’)){
$fname = “Add to MEDICARE.PRN”;
}elseif(strstr($ins, ‘PPO’)){
$fname = “Add to PPO.PRN”;
}elseif(strstr($ins, ‘HMO’) || strstr($ins, ‘SCAN’)){
$fname = “Add to HMO batch?”;
}
$text .= $fname.” <input type=’checkbox’ name=’addbatch’ value=’Y’> ”;
}
and heres what ive started in javascript, but it doesn’t work:
if(ins.match(IEHP) == ‘null’ && ins.match(Private) == ‘null’ && ins.match(Workers) == ‘null’){
if(ins.match(Medicare) != ‘null’){
fname = ‘Add to MEDICARE.PRN’
}elseif(ins.match(PPO) != ‘null’){
fname = ‘Add to PPO.PRN’
}elseif(ins.match(HMO) != ‘null’ || ins.match(SCAN) != ‘null’){
fname = ‘Add to HMO batch?’
}
document.getElementById(‘filename’).innerHTML = fname+”<input type=’checkbox’ name=’addbatch’ value=’Y>”
}