Solved

How to transfer 2 images from page1 to page2.

Posted on 2012-03-20
2
222 Views
Last Modified: 2012-04-04
I have 2 files a.htm and b.htm
a.htm contains

<div id="products">
<img src="p1.jpg" id="p1">
<img src="p2.jpg" id="p2">
</div>
<div id="fabrics">
<img src="f1.jpg" id="f1">
<img src="f2.jpg" id="f2">
</div>
<input type="button" id="btnnext" value="Click me">
From here, at a time only 1 image can be clicked and 1 fabric can be clicked.
The moment the btnnext is pressed, the product and fabrics image should be assigned to i1 tag and i2 tag in b.htm


b.htm
<div id="products">
<img src="i1" src="">
</div>

<div id="fabrics">
<img src="i2" src="">
</div>
0
Comment
Question by:searchsanjaysharma
2 Comments
 
LVL 18

Accepted Solution

by:
nap0leon earned 500 total points
ID: 37747117
I presume this is actually a form on a.htm and btnnext posts the form to b.htm.

Here is some CSS and HTML that shows how to use images as radio button where the radio button is placed off-screen so that no one actually sees the radio button, only the image which is a label for the button.

<style>
.hideThis{position: absolute;left: -9999px;style=-moz-opacity:0;filter:alpha(opacity:0);opacity:0;}
</style>
<form name="myForm" action="" method="get">
<div id="products">
	<label for="product1"><input type="radio" id="product1" name="product" class="hideThis" value="p1"><img src="p1.jpg" id="p1"></label>
	<label for="product2"><input type="radio" id="product2" name="product" class="hideThis" value="p2"><img src="p2.jpg" id="p2"></label>
</div>
<div id="fabrics">
	<label for="fabric1"><input type="radio" id="fabric1" name="fabric" class="hideThis" value="f1"><img src="f1.jpg" id="f1"></label>
	<label for="fabric2"><input type="radio" id="fabric2" name="fabric" class="hideThis" value="f2"><img src="f2.jpg" id="f2"></label>
</div>
<input type="submit" id="btnnext" value="Click me">
</form>

Open in new window


Once the form is submitted, you can handle the assignments on b.htm using your server-side language.
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 37809699
ok
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JavaScript waiting 14 69
count download link and run update query 9 56
Angular - following an example by an expert here (Julian) 11 29
Angular - break the dataset in chunks? 7 39
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now