< script language="javascript" > < !-- // function ckvar (cDept, cIndex) switch (cDept){ case "1": userform["strno"+cIndex].value = "201"; userform["street"+cIndex].value = "Poplar"; userform["city"+cIndex].value = "Memphis"; break; case "2": userform["strno"+cIndex].value = "201"; userform["street"+cIndex].value = "Poplar"; userform["city"+cIndex].value = "Memphis"; break; // other cases... } // -->and your select variable
< select size="1" name="D1" onchange="javascript:ckvar(this.value,'1');" > < option value="0">Make a Selection< /option> < option value="1">Bartlett Police Department< /option> < option value="2">Collierville Police Department< /option> < option value="3">Germantown Police Department< /option> < option value="4">Memphis Police Department< /option> < option value="5">Millington Police Department< /option> < option value="6">Shelby County Sheriff's Office< /option> < /select>(make sure extra spaces are removed and each option values are correct). Bear in mind that the way you are referencing the form object is not browser independent (don't know if that is a problem).