Solved

Getting, accessing dynamic textfield values

Posted on 2004-07-30
3
229 Views
Last Modified: 2006-11-17
Hi
I am working in PHP.I have tree view which is made with database. The database for this tree has a PARENT CHILD relation based in id. I have to give the user an option of adding new nodes at different tree levels. For that i am using textfields in the tree where ever the insertion of new node is possible. The question is that how can i come to know that which text field has which parent so that i can save its value, which will ba string, against its parent id....

ne suggestion, comment....

Regards

0
Comment
Question by:zsadal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 11675134
Well, either you or the user needs to specify where this new item will be attached - you can't just figure it out by magic. Perhaps a pop-up that lists all nodes so that they can select what it is attached to?
0
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 125 total points
ID: 11676750
My choice would be that if they want to modify the tree, each element on the tree has a button (or a series of buttons).

[+] Add Node
[-] Remove Node (only if end of tree)
[--] Remove Node and all sub nodes
[Up] Move the node above the previous node at the same level
[Down] Move the node below the next node at the same level
[Left] Move the node up 1 level.
[Right] Move the node down 1 level as a child of the node above.
[Edit] Alter this nodes properties.

That sort of thing.

Now, admittedly, this may look a little messy.

But each button's url would be something like ...

/amendtree.php?id=ThisNodesID&parentid=ThisNodesParentID


So, as part of the rendering you can create the urls for the images on the fly as you render the node iteself.

Are you using a proper tree class? One which says find this node or find path to this node,etc.

If so, I'd like to see it. I have a tree class which allows out of sequence addition. This means I can read data which is in the format of

nodeid, parentid, data

and then add it to the tree.

The tree sorts out the heirarchy at render time.

I don't have to add the data into the tree top down.

It also means that I only need to make 1 call to the database to retrieve all the nodes.

Richard.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 11781659
I'd very much like to see this working? Especially if you create a generic class or need any further help.

My ICQ : 1711757

Regards and thanks.
Richard.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question