View Full Version : JS - Edit in Place

08-15-2008, 06:32 PM
Hi people,

I'm currently developing a simple comments system and I'm trying to create a "Edit in Place" fuction to people fastly edit their messages...

It should be similar to what happens with fast edit options on vBulletion (this one) or IPB.

My currently JS code is:

// Edit in Place
// Por Fazedor de Site

function removeForm(){
/*function setAttributeIE(node, name, value) {
var i;
for (i = 0; i { if (node.attributes[ i ].type == type){ node.attributes[ i ].type = value; } }
function mostra(){





$id("form_altera").onsubmit = function(){
return false;






function editar(){

$id("editinplace").onclick = function(){


$id("editinplace").onmouseover = function(){
this.style.background = "#EDF4FC";
this.style.cursor = "pointer";

$id("editinplace").onmouseout = function(){
this.style.background = "";
this.style.cursor = "";


It works ok... but just for the first comment!

It is defined to work with, for example, <span id = "editinplace"> editable text </span>

Otherwise, each comment uses it unique ID...

So, basically it is necessary change it... I have thought in something like this, to get the function by ID:

function edit(id_post){
$id(id_post).onclick = function(){

But, only this, doesnt works.. (naturally) and my Javascript knowns are so limited, because I just began it some days ago.

Any suggestion?


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum