Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to transfer 2 images from page1 to page2.

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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

877 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