Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to transfer 2 images from page1 to page2.

Posted on 2012-03-20
2
Medium Priority
?
231 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 1500 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

670 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