simon551
IS-IT--Management
- May 4, 2005
- 249
Hi, Most of what I read about setting the focus of a field is on the load event. I'm trying to set the focus after a an event on the form. This event is firing (the other parts of the script work. But the .focus() doesn't seem to fire.
Any suggestions? Or is this just not an option?
Any suggestions? Or is this just not an option?
Code:
window.onload=activateFxFunction;
//the following function does the work: creates the string to be placed into the label field and sets up the fields
function setfields(){
var currname=document.getElementById('curr').value;
if (currname != "USD"){
document.getElementById("foreignlbl").innerHTML = "Foreign Amount";
document.getElementById("fxlbl").innerHTML = "Exchange Rate";
document.getElementById("amtUS").type="text";
document.getElementById("amtForeign").type="text";
document.getElementById("fxRate").innerHTML= fxRate;
document.getElementById("amtForeign").focus();
}
}
//this function calls the other on the changing of currency
function activateFxFunction(){
document.getElementById("curr").onchange=setfields;
}