Click to See Complete Forum and Search --> : Variables


dhpotter
06-19-2003, 09:58 AM
Hey ppl.

I need some help please.
I have got several bottles on a page. I need the user to choose a bottle then click a link (1st bottle) to store it in that position, then click the second bottle, then click a link(2nd bottle) to store it in the variable .

The objective is to get the user to choose 4 bottles, fill out some details and submit a form..

at the moment i am having trouble with thecreating of variables.any body have an idea of what the code would look like?

Thanks a million

D-H

Jona
06-19-2003, 10:07 AM
We might have a very good idea of what the code would look like--if we better understood what you wanted. :p
Could you post a link or some code? Could you explain a little better please--I'm not sure what you mean by "bottles." ;)

Jona

dhpotter
06-19-2003, 10:26 AM
Hey Jona.
Thank you for your help yesterday! You really did a great job!! :)

the link is http://www.a-newu.co.uk/followup.html

The initial idea is to click on a bottle, then click on the [1st bottle link] to store that bottle there, then proceed, and click on the second bottle and click on the [2nd bottle] link to confirm it, and so on till have 4 bottles. then display the choices so that one could send them in form ..

Jona
06-19-2003, 10:35 AM
OK, you don't need to have two links. You can just do it in one onclick:


<script type="text/javascript">
var bottles = new Array(4);
</script>

<img src="bottle_01.jpg" onClick="bottles[0] = this.src;">


And for the second set of bottles, change the above zero (0) to one (1), and so on.

Jona

dhpotter
06-20-2003, 04:15 AM
ok, i was thinking it would be better to do it in 2 clicks, as they might change their mind. In other words they can click any bottle they want and only when they click [1st bottle] does it commit that bottle to the variable.

Jona
06-20-2003, 12:56 PM
You could use form boxes, so they can not only change their mind but also see what bottles they have chosen.

Jona