|
-
Javascript Image Changes
Greetings forum members!
I've got what seems to be a simple problem calling for a simple solution, but working through it has become an issue for me.
Okay, details. I've got a web page with images across the top. When clicking on one of the images, there is a dynamic below that shows which image you selected. The entire code for my page is simply this:
<script language="JavaScript">
<!--
var backImage = new Array();
backImage[0] = "1.gif";
backImage[1] = "2.gif";
backImage[2] = "3.gif";
backImage[3] = "4.gif";
//-----------------------------
function changeBGImage(whichImage){
if (document.images){
document["rating"].src = backImage[whichImage];
}
}
//-->
</script>
And in the body, my code looks like:
<body>
<form action="process.asp" method="post">
<a href="javascript:changeBGImage(0)"><img src="1.gif" border="0"></a>
<a href="javascript:changeBGImage(1)"><img src="2.gif" border="0"></a>
<a href="javascript:changeBGImage(2)"><img src="3.gif" border="0"></a>
<a href="javascript:changeBGImage(3)"><img src="4.gif" border="0"></a>
<br><br><br>
<img name="rating" src="norating.gif"><br><br>
<input type="hidden" name="rating" value="rating">
<input type="submit" value="submit">
</form>
</body>
This all works beautifully, however, I want to pass a value to the next page based on what the user selects. It could be any value that identifies the selection, the important part is that it can be done. Hopefully there's a solution that can pass the value in a querystring or form. Either is fine with me.
Now, if you want to see it in action, please go here:
http://www.veelinx.com/javascripttest.asp
Please tell me that I'm crazy and that it can't be done, or if by some chance there is a solution, I would be more than grateful for some insight.
Your help is immensely appreciated!
Thank you.
Last edited by dangre; 08-24-2005 at 04:00 PM.
Similar Threads
-
By James Graham in forum .NET
Replies: 5
Last Post: 06-03-2013, 04:54 AM
-
Replies: 3
Last Post: 06-18-2005, 05:55 PM
-
Replies: 1
Last Post: 06-12-2003, 04:00 AM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
-
By Murray Foxcroft in forum Web
Replies: 5
Last Post: 11-02-2000, 02:42 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks