Please see the javascript below. In Safari if I tab into the field that calls this function the browser shuts down. If I click in the field everything works but the focus is not set. Any ideas how I may fix this? Or as a worst case at lease put in a fix to prevent the (Safari) browser from closing?
function addPasswordElement() {
inputElement = document.createElement("input");
inputElement.setAttribute("name","password");
inputElement.setAttribute("id","password");
inputElement.setAttribute("value","");
inputElement.setAttribute("type","password");
inputElement.setAttribute("size","10");
document.getElementById("password-span").appendChild(inputElement);
// need to use className and maxLength instead of setAttribute to work in IE
document.getElementById("password").className = "regtextbox";
document.getElementById("password").maxLength = "20";
// needs to be called twice to work in IE
document.getElementById("password").focus();
document.getElementById("password").focus();
}
function addPasswordElement() {
inputElement = document.createElement("input");
inputElement.setAttribute("name","password");
inputElement.setAttribute("id","password");
inputElement.setAttribute("value","");
inputElement.setAttribute("type","password");
inputElement.setAttribute("size","10");
document.getElementById("password-span").appendChild(inputElement);
// need to use className and maxLength instead of setAttribute to work in IE
document.getElementById("password").className = "regtextbox";
document.getElementById("password").maxLength = "20";
// needs to be called twice to work in IE
document.getElementById("password").focus();
document.getElementById("password").focus();
}