473,770 Members | 4,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding items to a list or menu

Not sure if it is a php question but since i am working in php here it is.

Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.

I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.val ue) to the list object so it will hold 5 items.

thanks for any suggestions

Roy
The Netherlands

Jul 17 '05 #1
5 2748

"R.G. Vervoort" <ro**********@r oyvervoort.nl> wrote in message
news:40******** *************@n ews.xs4all.nl.. .
Not sure if it is a php question but since i am working in php here it is.

Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.

I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.val ue) to the list object so it will hold 5 items.

thanks for any suggestions

Roy
The Netherlands


You're right. That's a JavaScript question. comp.lang.javas cript is
thataway. Sorry.

Oh, and don't cross-post.

Garp
Jul 17 '05 #2
"R.G. Vervoort" <ro**********@r oyvervoort.nl> wrote in message
news:40******** *************@n ews.xs4all.nl.. .
Not sure if it is a php question but since i am working in php here it is.

Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.

I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.val ue) to the list object so it will hold 5 items.

thanks for any suggestions


Just to piss off the other guy, here's the JS code for adding an item

var o = document.create Element('OPTION ');
o.innerText = textfield1.valu e;
o.value = 'Something';
document.getEle mentById('listb ox_id').appendC hild(o);

HTML:

<select id="listbox_id" >
<option>Hello </option>
...
</select>

Jul 17 '05 #3
"R.G. Vervoort" <ro**********@r oyvervoort.nl> wrote in message news:<40******* **************@ news.xs4all.nl> ...
Not sure if it is a php question but since i am working in php here it is.

Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.

I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.val ue) to the list object so it will hold 5 items.

thanks for any suggestions

Roy
The Netherlands


PHP is server side, it looks like you want to send items to a client
side app (javascript?) you could do something like this:

--->Snip!

<?php

$array = array('item1', 'item2', 'item3', 'item4'); //I use an array
here for simplicity, you could do the same with a dB query or the like

echo "<html>\n<head> </head><!--javascript-->"; //Not a javascript guy,
but you get the point

foreach($array as $key=>$item) {
echo "\n textdata.item$k ey=$item";
}

?>
<body> etc.....

<---

Not sure how javascript looks (started working with it in last 2 days)
but you can change that echo statement to what it should be in
javascript

Cheers!

Robert
Jul 17 '05 #4

"Chung Leong" <ch***********@ hotmail.com> wrote in message
news:1L******** ************@co mcast.com...
"R.G. Vervoort" <ro**********@r oyvervoort.nl> wrote in message
news:40******** *************@n ews.xs4all.nl.. .
Not sure if it is a php question but since i am working in php here it is.
Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.

I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.val ue) to the list object so it will hold 5 items.

thanks for any suggestions


Just to piss off the other guy, here's the JS code for adding an item

var o = document.create Element('OPTION ');
o.innerText = textfield1.valu e;
o.value = 'Something';
document.getEle mentById('listb ox_id').appendC hild(o);

HTML:

<select id="listbox_id" >
<option>Hello </option>
...
</select>


Heh, if you mean me as "the other guy", I'm happy he got his answer. And
when he asks which lace to cross next in four groups, you can help there too
(and repeat his cross-post again).

Hugs.

Garp
Jul 17 '05 #5
"Garp" <ga***@no7.blue yonder.co.uk> wrote in message
news:%j******** *************@n ews-text.cableinet. net...
Heh, if you mean me as "the other guy", I'm happy he got his answer. And
when he asks which lace to cross next in four groups, you can help there too (and repeat his cross-post again).


Oops. Didn't even check the to line.
Jul 17 '05 #6

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

Similar topics

2
3279
by: R.G. Vervoort | last post by:
Ho can i add items to (the item label=visual text and the value=index number) a list object on a website. I am having a list with 4 items and i would like to add the text from a textfield (textfield1.value) to the list object so it will hold 5 items. thanks for any suggestions Roy The Netherlands
2
4193
by: DFS | last post by:
I inadvertently deleted all the items from the built-in Access97 Window menu: Tile Horizontally, Tile Vertically, Cascade, etc. Can I somehow get them back without reinstalling Access97 (or creating them as my own custom items)?
0
1388
by: Claire | last post by:
When I run the following code through on the first round, my sub-menu (branched off mnuOpenPorts menuitem) shows a nice list of ports. When it gets run through on the 2nd pass, the sub menu indicates that it should be there but there's no items appearing in it. (ie a small indicator arrow is there showing there should be a sub menu but nothing pops up) When I step through the code, I have 5 items in Comports. After adding all the sub menu...
4
3508
by: Claire | last post by:
Sorry Ive added this twice (sortof) but if I'd added an addendum to the first one then this would probably have been ignored. This problem affects a ContextMenu attached to a NotifyIcon object. I don't get the problem with context menus attached to list boxes etc. Ive also seen a noticeable slow down in speed when the menu attempts to hide after the problem occurs. When I build a dynamic submenu on the first time round, it shows a nice...
10
21325
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles mnuTopics_Show.Select Dim mShowMenuItem As MenuItem mShowMenuItem = DirectCast(sender, MenuItem)
0
1193
by: Dino M. Buljubasic | last post by:
I have several context menu added to my forms. The forms are displaying items in a list view. When I click on an item in a list view, a popup context menu shows allowing me to chese between editing or deleting the item from the list view. That works fine. However, I noticed that I can call the pop up context menu also by right clicking on a list view item, just as it works by left clicking on it. However it this case my application...
1
4478
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup making it a shortcut menu. I have no problem linking it to the list control. The menu comes up when I right-click the list control.
2
5908
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more commands to the control's context menu? I'm envisioning a case where the control has a set of context menu items, and the parent form also has a set of context menu items. Thanks.
2
6999
by: RLN | last post by:
I was at this link to add a menu bar to my Access app. http://office.microsoft.com/en-s/access/HP051890341033.aspx I got the menu bar added, but had some more questions about it. In the link above, there was mention of assigning it as the "Global menu" bar, but it does not indicate how to specify a custom menu bar as the global bar. Any idea how to do this?
0
9602
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9882
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.