473,785 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with dynamically assigned ID's

17 New Member
Hello,

I have a form:

http://www.steinrogan.com/SecureSite...em_single.html

The idea is that every time the "Add a Dependant Item" button is clicked, the Item whose "Add a Dependant Item" button was clicked will have an additional field for another Dependant Item.

Similarly, when the "Add Another Item" button is clicked, the form will have another Item with all the usual fields.

How do I make it, so if I add a Dependant Item, it will be added to the Item it belongs to? As of now, if any of the "Add a Dependant Item" buttons is clicked, then the last added Item will be the one who will have a new field for a Dependant Item...even if I clicked the very first Item's "Add a Dependant Button."

More importantly, when all is said and done and sent to the server, how will the server know which Dependant Item belongs to which Item?

Thanks very much for your time!

Csanád
Jul 29 '07 #1
7 1294
acoder
16,027 Recognized Expert Moderator MVP
Have you solved this problem?

Is the numbering supposed to continue even when you remove dependent items?
Jul 31 '07 #2
Csanád
17 New Member
I've solved the first issue re: dependant items are placed where they belong.

With regard to numbering when you delete a dependant item, I haven't come up with an idea as how to renumber. Actually, renumbering is not that necessary and I can even remove the index from the title of each dependant item.

But my bigger problem is, how do I pass the following info to the server:

How many items/dependant items were added altogether?

How many dependant items does each item have?

I'm using PHP on the server-side.

Thanks for your help!
Aug 1 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
I've solved the first issue re: dependant items are placed where they belong.

With regard to numbering when you delete a dependant item, I haven't come up with an idea as how to renumber. Actually, renumbering is not that necessary and I can even remove the index from the title of each dependant item.

But my bigger problem is, how do I pass the following info to the server:

How many items/dependant items were added altogether?

How many dependant items does each item have?

I'm using PHP on the server-side.

Thanks for your help!
You can do this by using hidden elements. Just update them when you add/delete items.
Aug 1 '07 #4
Csanád
17 New Member
You can do this by using hidden elements. Just update them when you add/delete items.
How do I do that? How do I assign/update the value of the hidden elements?

Thanks.
Aug 2 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
How do I do that? How do I assign/update the value of the hidden elements?

Thanks.
Give them an id (as well as a name for the server-side script), then use
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(hidden_element_id).value=whatever;
to update the values. I assume you know that by hidden elements I mean input type=hidden form elements.
Aug 2 '07 #6
Csanád
17 New Member
Thank you so much!! It works now.

Best regards!

Csanád
Aug 2 '07 #7
acoder
16,027 Recognized Expert Moderator MVP
Thank you so much!! It works now.

Best regards!

Csanád
Glad you got it working.
Aug 3 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2405
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I have the same questions showing up again (along with the new questions) and I do not want them to....
1
521
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I have the same questions showing up again (along with the new questions) and I do not want them to....
9
7042
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related to VB, plus the address bar would show something like this: www.somethinghere?id=3 and if you change number 3 from the address bar to (for example) 34 or 71 you would get different page with the same formatting like I.e: www.somethinghere?id=34...
5
1500
by: arnabit | last post by:
I have created a dropdown ,which is inside a panel and the panel is inside a place holder . the panel and the dropdown is created dynamically. I do have a button when the button is clicked i am trying to read the values from the dropdown.but the problem i am facing is that i am not getting the id of the dropdown .Please advice me how to get the id of the dropdown .
7
6672
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
0
9643
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
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9946
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...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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
3645
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.