Solved

How to transfer 2 images from page1 to page2.

Posted on 2012-03-20
2
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…
Suggested Courses

630 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