Hello, I'm sorry I bumped old and solved article, so I'm opening new.

The problem is here:


This works fine, except that I have to click button two times the first time to change the status. later itr works fine. Anyone knows how to fix that?

Thank You!

Ok, so I found the problem.

When clicked first time, here:

var vars = 'id='+id+'&value='+obj.value;

obj.value is not set, and that's why I have to click twice. Anyone knows hot to make it work?

Figured out, the problem is in lines:

'<input type="image" onclick="updateToggle(this, ' . $row["sifra"] . ');" src="status-toggle_enabled.jpg" border="0" name="enabled" value="0"/>';

just had to invert "value" :)