View Single Post
  #2 (permalink)  
Old November 11th, 2003, 12:15 AM
vknowles vknowles is offline
Authorized User
Join Date: Jun 2003
Location: Lexington, KY, USA.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post

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.

(Old dog learning new tricks...)
Reply With Quote