JohnCP Posted May 8, 2007 Share Posted May 8, 2007 Hi all, I think my topic title describes my question. I can't seem to figure out how to auto-populate a text box that is right below a drop-down field. When the user selects an item from the drop-down, the selected item should auto populate the text box.Any help is greatly appreicated.Thanks,JP Link to comment Share on other sites More sharing options...
aspnetguy Posted May 8, 2007 Share Posted May 8, 2007 HMTL ...<select id="ddl" onchange="autoFill(this)">...options...</select><br/><input type="text" id="txt" value=""/> js function autoFill(ddl){ var txt = document.getElementById("txt"); txt.value = ddl.options[ddl.selectedIndex].value;} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.