Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting data from a dropdown list in .NET to place in a Textbox

Status
Not open for further replies.

SonOfZeus

Programmer
Mar 6, 2002
53
CA
I've developed javascript code that works within .NET, when an item is selected from a DropDownList, a textbox on the screen is filled with this value. The problem I have now is that I want all the formatted text (Carriage returns and all) in the item selected in the dropdown list to be copied across. Currently, all whitespace coding is lost in the process.
 
First, Javascript works client side, where there is no .NET, no ASP, no JSP. Show the client side code from the browser so we can see what needs to be done.

Lee
 
Sorry for the poor use in terminology, but the javascript function is:

function NoteChange(dropdownControl)
{
var strTemp;
var strTemp2;
strTemp2 = dropdownControl.options
[dropdownControl.selectedIndex].innerText;
strTemp = document.all["txtBidInvoiceNote"].value;
if (strTemp2 != "")
{
if (strTemp != "")
strTemp = document.all["txtBidInvoiceNote"].value
+ "\r\n"+ dropdownControl.options
[dropdownControl.selectedIndex].innerText
else
strTemp =dropdownControl.options
[dropdownControl.selectedIndex].innerText;
}
document.all["txtBidInvoiceNote"].value = strTemp;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top