473,395 Members | 1,791 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,395 software developers and data experts.

multiple items with the same id (edit-in-place)

Hi all,
I'm seeking for solution of my post in php forum of this site (http://www.thescripts.com/forum/thread777667.html). So does any here know how to solve it? Thanks.
Mar 3 '08 #1
7 1963
Hi anyone know how to do this? Thanks a lot.
Mar 5 '08 #2
ronverdonk
4,258 Expert 4TB
As I recall an answer was given (by me) in post http://www.thescripts.com/forum/post3097097-6.html in the PHP forum.

Why don't you react to that post and tell us what you did with its suggestion. When you do not react tot posts, people are not inclined to continue their assistance.

Ronald
Mar 5 '08 #3
As I recall an answer was given (by me) in post http://www.thescripts.com/forum/post3097097-6.html in the PHP forum.

Why don't you react to that post and tell us what you did with its suggestion. When you do not react tot posts, people are not inclined to continue their assistance.

Ronald
Hi ronverdonk, I'm sorry about that. I thought you ask me to post here rather than in PHP forum. Thanks for your help. I did try your suggestion but I modify a bit in the fifth line and also the <b>editinplace.js</b> as shown below. After I tried, I got what I want but that's an error on page icon show in the left bottom of my ie browser. Do you what happen to this error?

Expand|Select|Wrap|Line Numbers
  1. Line: 3813
  2. Char: 5
  3. Error: Object required
  4. Code: 0
  5.  
[PHP]
while($disp=mysql_fetch_array($disp_de))
{
echo '<tr><td>';
$dis= $disp['pp_photo_desc'];
echo '<p id="desc'.$a.'">'.$dis."</p>";
echo '</td></tr>';
$a++;
}
[/PHP]

Expand|Select|Wrap|Line Numbers
  1. function init(){
  2. var max=50;
  3. for(i=0; i<max ;i++){
  4. makeEditable('desc'+i);
  5. }
  6. }
  7.  
Mar 5 '08 #4
ronverdonk
4,258 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. function init(){
  2. var max=50;
  3. for(i=0; i<max ;i++){
  4. makeEditable('desc'+i);
  5. }
  6. }
are you sure you have 50 items to makeEditable? I assume that you have less and therefore you run into this error. If you use the dom to do anything you must verify in your JS rouitine that the object exists.

Ronald
Mar 5 '08 #5
are you sure you have 50 items to makeEditable? I assume that you have less and therefore you run into this error. If you use the dom to do anything you must verify in your JS rouitine that the object exists.

Ronald
haha, not sure. Sometimes less than but sometimes more than that. But due to this, I ever tried to put the for statement like for(i=0; ;i++), but this will make my pc hang. If really can't verify, then do you have any idea to make the error on the page icon disappear? Thank you. ^^
Mar 5 '08 #6
ronverdonk
4,258 Expert 4TB
My opinion is to test the existence of the id in the function, like
Expand|Select|Wrap|Line Numbers
  1. function init(){
  2.   var myId;
  3.   var max=50;
  4.  
  5.   for(i=0; i<max ;i++){
  6.     myId='desc'+i;
  7.     if (getElementById(myId))       
  8.        makeEditable(myId);
  9.   }
but I am not a really good JS expert, so give it a try.

Ronald
Mar 5 '08 #7
My opinion is to test the existence of the id in the function, like
Expand|Select|Wrap|Line Numbers
  1. function init(){
  2.   var myId;
  3.   var max=50;
  4.  
  5.   for(i=0; i<max ;i++){
  6.     myId='desc'+i;
  7.     if (getElementById(myId))       
  8.        makeEditable(myId);
  9.   }
but I am not a really good JS expert, so give it a try.

Ronald
Thanks. I had tried this, but it can't work on my case. It still have the error on page as shown below.

Expand|Select|Wrap|Line Numbers
  1. Line: 9
  2. Char: 5
  3. Error: Object expected
  4. Code: 0
  5.  
Mar 6 '08 #8

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

Similar topics

0
by: Ringwraith | last post by:
Hi! Have anyone ever tried to modify the Gene Cash's Tkinter tree widget (available from http://home.cfl.rr.com/genecash/) so it supports multiple items selection ( selection of multiple files...
1
by: DC Gringo | last post by:
I'm having such a problem with this DropDownList in a user control that is posting back and throwing an error: System.Web.HttpException: A DropDownList cannot have multiple items selected ...
1
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...
3
by: Dany P. Wu | last post by:
Hi everyone, One of my Windows forms contain two listbox controls, with Add and Remove buttons between them. The idea is to allow users to select multiple items from one ListBox, click the...
2
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...
2
by: =?Utf-8?B?S3Jpc2huYQ==?= | last post by:
Hi, I am devloping one web application using .net framework 2.0.One page has 7 dropdown list control.When i update the values first bind the values to the drop down llist then selected text...
4
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...
1
by: KrazyKasper | last post by:
Access 2003 – Multi-Column List Box – Select Multiple Items I have a multi-column (3 columns) list box that works well to select one set of records or all sets of records (based on the first field...
17
DjPal
by: DjPal | last post by:
Hello, I am trying to move multiple items from one list box to another, i have tried the following code, but the output so far just gives me "{collection}" in the other list box. private void...
1
by: loknath11 | last post by:
I have problem with posting multiple items from sel2 to database without selection.It will so kind from you if you could look my code. ///certificate.php <html> <head> <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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,...

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.