Huge Problem -- Need Help ASAP

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Deacon
Forum Newbie
Posts: 1
Joined: Wed Dec 11, 2002 9:16 am

Huge Problem -- Need Help ASAP

Post 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...
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

piece a cake with PHP but most of us here are PHP coders so try going to a javascript forum.

Sorry
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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.
Post Reply