Notify Message
Forums
#7118993 Dec 16, 2012 at 10:10 PM · Edited over 4 years ago
Shiny Gem
344 Posts
So...

I need to store information in two diffrent var's, more specifically, text and image url. The text and images will be selected in a checkbox like fashion. Then i need to push them onto a pop-up window when clicking a button!

The thing is that i got a set of templates i have to go after, so i need to store the information in a var called "imgUrlList" and "imgTextList". then the rest will pretty much fix itself!

The text being the <span> tags in the divs holding ze images.

To see what i need to do, hoover over a img, check the checkbox and then press the button on the bottom.

Here is the site;
http://www.fc.lnu.se/~kc222bh/test2/slideshow/index.htm

Quote
#7119029 Dec 16, 2012 at 10:20 PM · Edited over 4 years ago
Leader
630 Posts
You know you can view that websites source right?

Edit: Aha I see... Let me think about that.
Quote
#7119066 Dec 16, 2012 at 10:29 PM · Edited over 4 years ago
Leader
630 Posts
Crude solution:
Send the two arrays through the form-post as json-objects and parse them back into arrays on the other side.

1. make a hidden field in the form and give it an id and a name
2. var jsonArray = JSON.stringify({imgUrlList: imgUrlList});
3. store this variable in the hidden field with $("#id").val(jsonArray);
4. parse on other side with var imgUrlList = JSON.parse($_POST['name']).getString('imgUrlList');

Ask me on mumble if this is too difficult.
I use jQuery quite often to simplify silly JavaScript.

Also google this list:
javascript parse json
javascript array to json
jquery selector
Quote
#7119350 Dec 16, 2012 at 11:27 PM · Edited over 4 years ago
Shiny Gem
92 Posts
Im no good with Javascript, but i googled Haaaalp and this video came up. Is this similar to the problem you are having?

http://www.youtube.com/watch?v=ndFYzTT9RhU

I would use a Javascript manual book to beat the little white dog to stop it sniffing your anus.

Glad i could help.
Quote
#7137490 Dec 21, 2012 at 01:23 AM
Shiny Gem
344 Posts
Aah! I will try that out once i get back on it!
Thanks for your time Sade :3

And Zharko.. haha, i dont even have a respons..
Quote