aroc725
12-24-2008, 05:32 PM
I have several data entry pages in my Web application, and they have textboxes that need to appear when their labels (property names) are clicked, and disappear when their labels are double-clicked. I'm using JavaScript to make this happen (see code below), but for some reason, the only way I can enter any text into a textbox is if I keep the mouse-button pressed down within the textbox while I'm entering something. (I'm seeing this w/both IE and Firefox). But when I tab to the next textbox, what I entered in the previous textbox disappears. Is there any way to fix this?
JavaScript code to display the property name, textbox and label:
document.getElementById("div" + className).innerHTML = newClassName + "<br><input type='text' name='txt" + className + "' onBlur='javascript:updateDOM(this);' />" + label;
JavaScript code to just display the property name:
document.getElementById("div" + className).innerHTML = newClassName;
JavaScript code to display the property name, textbox and label:
document.getElementById("div" + className).innerHTML = newClassName + "<br><input type='text' name='txt" + className + "' onBlur='javascript:updateDOM(this);' />" + label;
JavaScript code to just display the property name:
document.getElementById("div" + className).innerHTML = newClassName;