Jump to content

JavaScript+PHP?????????


ausgezeichnete

Recommended Posts

i have this js code

[HIGHLIGHT=JavaScript]

function saveImageOrder()

{

var orderString = "";

var objects = document.getElementsByTagName('DIV');

for(var no=0;no<objects.length;no++){

if(objects[no].className=='imageBox' || objects[no].className=='imageBoxHighlighted'){

if(orderString.length>0)orderString = orderString + ',';

orderString = orderString + objects[no].id;

}

}

 

document.getElementById('debug').innerHTML = 'This is the new order of the images(IDs) : <br>' + orderString;

 

}

 

[/HIGHLIGHT]

and this is my php code

<?php do { ?>

<div class="imageBox" id="<?php echo $row_Recordset1['gallery_fotos_id']; ?>">
	<div class="imageBox_theImage" style="background-image:url('<?php echo $row_Recordset1['gallery_fotos_img']; ?>')"></div>	
<?php echo $row_Recordset1['gallery_fotos_id']; ?>
</div>	



          <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

my problem that i want to update the ID's of the images with the Id's given in the orderString

 

This is the new order of the images(IDs) :

imageBox1,imageBox0,imageBox2,imageBox3,imageBox4,imageBox5,imageBox6,imageBox7,imageBox8,imageBox9,imageBox10,

imageBox11,imageBox12,imageBox13,imageBox14,

 

am using this form

<FORM name="myForm" action="" method="post">

 

<INPUT type="hidden" name="imageIdList">

<input type="button" style="width:100px" value="SET ORDER" onClick="saveImageOrder()">

</FORM>

 

Please can u tell me how can i update them????

this is for a drag a drop gallery photos and i want the user able to save the changes he/she made

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.