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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.