I have a section of my app that uses Ajax to populate certain fields. I am trying to figure out how to set focus to an item, then set focus again to a different item. In my screenshot http://twitpic.com/ysyz5 , under "Investigative Troopers", when a Radio# is entered, the FirstName,LastName,and Troop is populated. The focus is initially set to the Role field. What i am wanting is after the user selects a Role, the focus should then be set next to the next Radio# field. My Ajax code is below. Is anyone able to help out? Thanks
Deanna
<script language="JavaScript" type="text/javascript">
function pull_set_value18(pValue){
var get=new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=Set_Item18',0);
if(pValue){
get.add('122_TP_APP_ITEM',pValue)}
else{
get.add('122_TP_APP_ITEM','null')}
gReturn=get.get('XML');
if(gReturn){
var l_Count=gReturn.getElementsByTagName("item").length;
for(var i=0;i<l_Count;i++){
var l_Opt_Xml= gReturn.getElementsByTagName("item");
var l_ID=l_Opt_Xml.getAttribute('id');
var l_El=html_GetElement(l_ID);if(l_Opt_Xml.firstChild){
var l_Value=l_Opt_Xml.firstChild.nodeValue;}
else{
var l_Value='';}
if(l_El){
if(l_El.tagName=='INPUT'){
l_El.value=l_Value;}
else if(l_El.tagName=='SPAN'&& l_El.className=='grabber'){
l_El.parentNode.innerHTML =l_Value;l_El.parentNode.id=l_ID;}
else{l_El.innerHTML=l_Value;}}
document.getElementById('P122_TROOPER_SCENE_ROLE_3').focus();}}get=null;}
</script>
Edited by: Dclipse03 on Jan 19, 2010 8:18 AM