473,659 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to do the multiple items with the same id?

17 New Member
Hi all,
I'm having the problem while using the edit-in-place scripts from internet. It's ok when i just used for one text id, but after i added a while loop because of multiple items and it become only the 1st text id content works. So below here i post a piece of my code, hope any here can help on this. How to do the multiple items with the same id? Please help. Thank you very much.

[PHP]while($disp=mys ql_fetch_array( $disp_de))
{
echo '<tr><td>';
$dis= $disp['pp_desc'];
echo "<p id=\"desc\">".$ dis."</p>";
echo '</td></tr>';
}[/PHP]
Mar 2 '08 #1
5 2401
Markus
6,050 Recognized Expert Expert
You can't dop multiple items with the same id; they're intended t be unique.

And also, thanks!
I've been looking for something like this :P
Mar 2 '08 #2
littlegreen
17 New Member
hi, ic but do you know how to solve this? Because I need it to be display and editable in place. But since that can't be same id then does it have any other choices to do this? for example, like flickr. It can be edited after one click although with multiple editable id or whatever...do you know this? Thanks.
Mar 3 '08 #3
Markus
6,050 Recognized Expert Expert
Through the onclick of an element you could pass the id of said element to the javascript function.
Expand|Select|Wrap|Line Numbers
  1. function editable(elementID, otherVars)
  2. {
  3. // code 
  4. }
  5.  
Expand|Select|Wrap|Line Numbers
  1. <p id="something" onclick="editable(this, something_else)">
  2. sdsfsdf</p>
  3.  
Mar 3 '08 #4
littlegreen
17 New Member
thanks, I'll try but i don't really god in javascripts.
Mar 3 '08 #5
ronverdonk
4,258 Recognized Expert Specialist
thanks, I'll try but i don't really god in javascripts.
In order to make your ID's unique is to use a sequence counter and concat that to the name 'desc', so in your code e.g.[php]$i=0;
while($disp=mys ql_fetch_array( $disp_de))
{
echo '<tr><td>';
$dis= $disp['pp_desc'];
echo "<p id='desc".$i."' >$dis</p>";
echo '</td></tr>';
$i++;
}[/php]
Most likeable success on JavaScript help with problems is in the JavaScript forum.

Ronald
Mar 3 '08 #6

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

Similar topics

3
13213
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax: Hunter_69. Here is what the form looks like. I have the difficulty of inserting the multiple items selected by the user the first time he visits and uses the screen and then using an UPDATE when he visits later. Model | Original Price | Reduced Price...
6
4288
by: Ben Hallert | last post by:
Hi guys, I'm trying to figure out what bone headed mistake I made on something I put together. I've got a form (named 'context') that has a variable number of select-multiple inputs on it. Based on the number of variables passed through a GET string, I want to multiply the total number of selected items for each together to see how many possible combinations the selected items are generating. The following snippet of code...
2
2267
by: Peter | last post by:
Hello! Please, could anyone tell, is it possible to set multiple items to be selected in list control in the code? For example when the web form is loaded three items of 5 are selected in list control already? Now I manage to set only one item to be selected during page load, but there is need to multiple items could be selected for the user. I appreciate very much your help! Thanks.
1
2233
by: sab | last post by:
Hi, We have a web form with a listbox. The listbox is a multiple select listbox and has data that looks something like: ALL Unit 1 Unit 2 Unit 3 Note: "ALL" is always the first item in the list.
1
2912
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we have written the code using radio button for selecting single item.but we want to replace it with checkbox to select multiple items. the code using radio button is given below .pls correct it with checkbox
10
6367
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code: dropdownlist.items.findbyvalue("value").selected = true I didnt specify any selected item in the dropdownlist during binding to the datasource. I use dropdownlist.clearselection() but still error occurs. I need information on this. Thanks. Ads
2
8145
by: anchi.chen | last post by:
Hi People, Just wondering if any of you have ever come across any javascript examples that will allow one to drag and drop multiple items between lists? That is, users would be able to use the "Shift" or "Ctrl" buttons to select multiple items from LIST 1 and drag them to LIST 2 in one go. I've already have the code to drag and drop between lists but for 1 item at a time. The only method to move multiple items between lists
10
3673
by: kimiraikkonen | last post by:
Hi, I have an app which has a listbox and when i double click an associated fileS, i want their paths to be added into listbox in my application. This code works good when i try to open a "single" file with my app which works to get commandline arguments to get file paths: Dim cla As String() = Environment.GetCommandLineArgs() If cla.Length 1 Then
4
2218
by: swethak | last post by:
hi i wrote a code to select multiple items in a drop down list.And i store all the items in my database.But in that i select multiple items and submit that items last item only stored.Please tell that what's the mistake in my code. <td><select name="imagelist" id="imagelist" multiple="multiple"> <? while($row=mysql_fetch_array($result)) {
25
5387
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. Basically i have a multiple select box. An it works except for this one part i want to add to it.The first box i have is called project members which shows the users you can choose to send an email to and the other box is called assignees which is the...
0
8427
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
8851
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
8746
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...
0
8627
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
7356
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
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
4175
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...
1
2750
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
1975
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.