populating textboxes using list/Menu
Hi! to all I posted here in Javascipt forum below is the reply of Van. and it work in populating 1 textbox. now it requires 4 textboxes to be populated. I need your help
Below is the Code
I think there are several problems in your code.
First, an OPTION object has a VALUE property. Also, the carriage-return you want is not an HTML <br>, but rather an ASCII 13.
So your option constructor should be like this:
Response.Write "<option value='" & objRSt("email") & "'>" & objRSt("assign") & "</option>" & chr(13)
Then, you need to access your selected item. A SELECT object has a couple of properties you can use. I will give two examples of how to change PutEmail().
Since you are passing "this", you can use it as the object reference.
//IE 4.0+, Netscape 6.0+
document.form1.txtEmail.value = objThis.value;
//IE 3.02+, Netscape 2.0+
document.form1.txtEmail.value = objThis.options[objThis.selectedIndex].value;
The newer version is much simpler, but it doesn't work with older browsers.