Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2005, 10:05 PM
Authorized User
 
Join Date: Jun 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default 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

Thanks,
Rylemer

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.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating a list box VBAbeginner Access VBA 1 April 8th, 2008 09:24 AM
VBScript to list Textboxes on page Ron Howerton VB How-To 5 October 5th, 2007 08:28 AM
textboxes or list boxes with multiple fore color svharishtech Pro VB 6 5 April 20th, 2007 05:04 PM
Populating report or form textboxes Bosstone100 Access VBA 3 November 15th, 2004 03:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.