Jump to content

some ideas needed


adam291086

Recommended Posts

I am working on this project and need a little help. If you go to http://adamplowman.co.uk/Rubber_Duckie/moving.php  you can move one of the boxes around and click on update, then if you go back to the page and refresh it, the  changes are present.

 

The problem is that i want to beable to move and change many items and up date all of them in the database, is there a way to do this???

 

I use php to get the objects style info from the database and then javascript to play with the objects. Any help is appreciated

Link to comment
https://forums.phpfreaks.com/topic/112645-some-ideas-needed/
Share on other sites

you could create another hidden form element called div_name2 and use the following (you will have to record the div_name2 in the db as well):

 

function update()
{
var divID=dobj.id.substring(3,4);
if(divID=='1') {
document.getElementById('div_name').value = dobj.id; }
if(divID=='2') {
document.getElementById('div_name2').value = dobj.id; }

document.getElementById('height').value = dobj.style.height;
document.getElementById('width').value = dobj.style.width;
document.getElementById('top').value = dobj.style.top;
document.getElementById('left').value = dobj.style.left;
}

Link to comment
https://forums.phpfreaks.com/topic/112645-some-ideas-needed/#findComment-578485
Share on other sites

var divIDs= new Array;
function update()
{
var divID=dobj.id.substring(3,4)-1;
divIDs[divID]=[dobj.style.height,dobj.style.width,dobj.style.top,dobj.style.left];
}
function formsubmit() {
var infostring=divIDs.join('$$');
document.getElementById['info'].value=infostring;

then enter the value of info into the database and break up the array into the correct variables when the page loads.

Link to comment
https://forums.phpfreaks.com/topic/112645-some-ideas-needed/#findComment-578512
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.