473,413 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

HTML ListBox

Hi Everyone
im using an html textbox that runat server in webform1 and i send it the
value from webform2 using the following script :
Response.Write("<script>window.opener.Form1.textbo x.value = '" + variable+
"' </script>")

It Works

The problem that i want to replace the html textbox with html listbox (also
runat server)so it can hold several items, so i tried this script

Response.Write("<script>window.opener.Form1.listbo x1.items.add( '" +
variable+ "') </script>")

But it gives me error in script, Any idea about how to make it work?????

Thx in Adv
Nov 18 '05 #1
1 2024
Hi,

Try this:

Response.Write("<script> AddItem('test', '0') </script>")

Then in your aspx page have this:

<script language='javascript'>
function AddItem(strText, strValue) {
listbox1.options.add(document.createElement("optio n"));
listbox1.options[(listbox1.options.length - 1)].text = strText;
listbox1.options[(listbox1.options.length -1 )].value = strValue;
}
</script>

Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Mariame" <Ma************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Everyone
im using an html textbox that runat server in webform1 and i send it the
value from webform2 using the following script :
Response.Write("<script>window.opener.Form1.textbo x.value = '" + variable+
"' </script>")

It Works

The problem that i want to replace the html textbox with html listbox (also runat server)so it can hold several items, so i tried this script

Response.Write("<script>window.opener.Form1.listbo x1.items.add( '" +
variable+ "') </script>")

But it gives me error in script, Any idea about how to make it work?????

Thx in Adv

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Crystal | last post by:
Ok, I know this sounds weird, but it's really bugging me. I have a few list boxes on my form (basic pick a month, year, state stuff) and you can only choose one value. I need to be able to run a...
17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
6
by: Sam Martin | last post by:
Hi all, I'm looking for a ListView/ListBox control that can render simple HTML markup when drawing its list items. Anyone got any ideas? TIA Sam Martin
17
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
2
by: louise raisbeck | last post by:
Hi there. I am a little confused. SelectedValue is a property of ListBox and dropdownlist. However it isnt in the list of properties in intellisence (html view i am not talking about code behind...
0
by: deepak | last post by:
Hi all, i m transefering values from one listbox to another listbox using javascript(both are html controls), the first listbox is populating with database at page_load time and the second listbox...
7
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
6
by: zalek | last post by:
Maybe someone can show me an example of a listbox with 2 columns and a vertical bar created by HTML (JavaScript is OK). Thanks, Zalek
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.