Page 1 of 1

Huge Problem -- Need Help ASAP

Posted: Wed Dec 11, 2002 9:16 am
by Deacon
need to know how to select something (using checkbox) and when the desired number of items are selected...the are displayed in a PARTICULAR order on the screen. This must be done in Javascript, and not PHP!

Basically, someone selects maybe 10 pics, and then when the click submit, the pics are arranged in a particular order (based on their value) no more then 4 across (if there are more than 4, the items need to be arranged in a new row)

Thank You for your help in advance...

Posted: Fri Dec 20, 2002 11:46 pm
by evilcoder
piece a cake with PHP but most of us here are PHP coders so try going to a javascript forum.

Sorry

Posted: Sat Dec 21, 2002 9:42 am
by Johnm
Why does it have to be in JS?
Can't you use the functionality of PHP to write the necessary JS?


John M

Posted: Sat Dec 21, 2002 10:28 am
by Gen-ik
It can't be done in JavaScript the way you want it to.

The only way I can see of doing this is to have a table on your page arranged as a grid to display your images.

Create an images called blank.jpg or something and load this as an <img> into each part of your grid.

Give each <img> in your grid a name such as <img name="image1"... <img name="image2"... and so on.

Then you can use JavaScript to target and change each image as you wish... don't forget the images will all have to be the same size for this to work properly.

To change one of your images you can do something like this..

document.image1.src="the_new_image.jpg";

and JavaScript will load the_new_image.jpg into <img name="image1">



Hope this helps.



You shouldn't expect people here to write an entire piece of script for you.. especially when you have no idea what so ever of how to do it your self.