DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Multiple items with the same id problem (edit-in-place) (http://www.daniweb.com/forums/thread112004.html)

littlegreen Mar 3rd, 2008 11:55 am
Multiple items with the same id problem (edit-in-place)
 
Hi all,
Actually, I had posted a thread in the php forum. But I don't know the javascripts and AJAX very well, so would like ask for help from anyone here.

The code below is originally from edit-in-place scripts. But this didn't work for my case. Does anyone know about this?

inside editinplace.js
function init(){
var max=50;
for(i=1; i<max; i++){
makeEditable('item_'+i ; );
}
}

Thanks in advance.

MidiMagic Mar 3rd, 2008 8:11 pm
Re: Multiple items with the same id problem (edit-in-place)
 
You can't have multiple items with the same id. It is a W3C violation.

littlegreen Mar 3rd, 2008 11:19 pm
Re: Multiple items with the same id problem (edit-in-place)
 
Hi MidiMagic,
ya I just know about that. But what should I do with the multiple id and the javascripts code? Since I have to loop it, that is harder for me without using a while. Besides that, I'm very poor in javascripts. Can you help on this? Thank you very much.

sbv Mar 5th, 2008 5:08 am
Re: Multiple items with the same id problem (edit-in-place)
 
hi
you can access multiple controls as...
For i = 8 to 13
               
                fileName  = LCase(load.getFileName("file" & i ))

Got it?

littlegreen Mar 5th, 2008 6:09 am
Re: Multiple items with the same id problem (edit-in-place)
 
Quote:

Originally Posted by sbv (Post 552678)
hi
you can access multiple controls as...
For i = 8 to 13
               
                fileName  = LCase(load.getFileName("file" & i ))

Got it?



Hi sbv,
Thanks, but i don't get what you mean (forgive me because I'm quite blur)? :-/ mm.. is it related to uploading files? If that is the case, I don't need to upload any file.. and where should I place your code? the code you provided is in what language? ASP? For your information, I'm using PHP.;) Thanks.

DangerDev Mar 5th, 2008 8:36 am
Re: Multiple items with the same id problem (edit-in-place)
 
Quote:

Multiple items with the same id problem (edit-in-place)
this is your heading but you are telling you are using PHP. id is used at client side programming.

so what is actually your problem ????

what you want to do in PHP ??
your exact problem definition will help us to answer you quickly.

what ever sbv ^ has posted is a way to solve id problem. using this example you can solve your id problem. this is not the exact solution but a way how probably you can solve same id problem.

littlegreen Mar 5th, 2008 12:06 pm
Re: Multiple items with the same id problem (edit-in-place)
 
oh i see, because I don't really familiar of that code. mm.. maybe I should put edit-in-place using AJAX, Javascripts, and PHP problem. I'm sorry to confusing all.

sbv Mar 5th, 2008 11:10 pm
Re: Multiple items with the same id problem (edit-in-place)
 
So did you get the solution yet or not. If no then please elaborate your need.

Best Luck

littlegreen Mar 6th, 2008 5:23 am
Re: Multiple items with the same id problem (edit-in-place)
 
Quote:

Originally Posted by sbv (Post 553353)
So did you get the solution yet or not. If no then please elaborate your need.

Best Luck



Thanks, sbv. I had done what I want but there's another problem with me. There's a error on the page icon appears in my ie browser when i view the page. I don't know why...

inside the editinplace.js,
function init(){
var max=50;
for(i=1; i<max; i++){
makeEditable('item_'+i ); // after i remove the semicolon, i can get what i need. but i get the error on the page icon in the left bottom of the browser.
}
}


All times are GMT -4. The time now is 4:06 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC