473,581 Members | 3,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing an image via ID on main page from second form

RWC
Hello,

I have a page connected to an SQL table. The page loops through, creating a
row for each record, displaying in image, the ID of which is set to the
record id. When I click a button to change the image, I'd like to refer to
the ID on the main page, but change the image on the main page. Any idea
how to do this?

Example is as follows

Record 1 ID=1 NAME=Image1 Src=bird.jpg
Record 2 ID=2 NAME=Image1 Src=horse.jpg
Record 3 ID=3 NAME=Image1 Src=cow.jpg
When I open the child window and select a new image for Record 3, I'd like
to change the record 3 src to insect.jpg.

I've changed the value of things based on teh Name element but never the ID.
How do I do that?

Any help would be great!

Thanks in advance!
Rick
Jul 23 '05 #1
2 1405
RWC wrote:
Hello,

I have a page connected to an SQL table. The page loops through, creating a row for each record, displaying in image, the ID of which is set to the record id. When I click a button to change the image, I'd like to refer to the ID on the main page, but change the image on the main page. Any idea how to do this?

Example is as follows

Record 1 ID=1 NAME=Image1 Src=bird.jpg
Record 2 ID=2 NAME=Image1 Src=horse.jpg
Record 3 ID=3 NAME=Image1 Src=cow.jpg
These are not valid id's. An id:

"...must begin with a letter ([A-Za-z]) and may be followed by any
number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
colons (":"), and periods (".")"

Though they probably work in most browsers (but that doesn't make them
valid HTML).

Using identical names for the images will cause problems also, though
most browsers will tolerate it. Names on images should be unique.
Browsers will likely return the first image with the name, but you
should not depend on that behaviour.

Your HTML should look something like like:

<tr><td><img name="Image1" id="Image1" src="brid.jpg"> </td></tr>
<tr><td><img name="Image2" id="Image2" src="horse.jpg" ></td></tr>
<tr><td><img name="Image3" id="Image3" src="cow.jpg"></td></tr>

Others may comment on the use of tables for layout...
When I open the child window and select a new image for Record 3, I'd like to change the record 3 src to insect.jpg.

I've changed the value of things based on teh Name element but never the ID. How do I do that?


The easiest way is to use the images collection:

opener.document .images['Image3'].src = 'insect.jpg'

--
Rob

Jul 23 '05 #2
RWC
Excellent. Thanks Rob, I will give that a try.

Rick

"RobG" <rg***@iinet.ne t.au> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
RWC wrote:
Hello,

I have a page connected to an SQL table. The page loops through,

creating a
row for each record, displaying in image, the ID of which is set to

the
record id. When I click a button to change the image, I'd like to

refer to
the ID on the main page, but change the image on the main page. Any

idea
how to do this?

Example is as follows

Record 1 ID=1 NAME=Image1 Src=bird.jpg
Record 2 ID=2 NAME=Image1 Src=horse.jpg
Record 3 ID=3 NAME=Image1 Src=cow.jpg


These are not valid id's. An id:

"...must begin with a letter ([A-Za-z]) and may be followed by any
number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
colons (":"), and periods (".")"

Though they probably work in most browsers (but that doesn't make them
valid HTML).

Using identical names for the images will cause problems also, though
most browsers will tolerate it. Names on images should be unique.
Browsers will likely return the first image with the name, but you
should not depend on that behaviour.

Your HTML should look something like like:

<tr><td><img name="Image1" id="Image1" src="brid.jpg"> </td></tr>
<tr><td><img name="Image2" id="Image2" src="horse.jpg" ></td></tr>
<tr><td><img name="Image3" id="Image3" src="cow.jpg"></td></tr>

Others may comment on the use of tables for layout...
When I open the child window and select a new image for Record 3, I'd

like
to change the record 3 src to insect.jpg.

I've changed the value of things based on teh Name element but never

the ID.
How do I do that?


The easiest way is to use the images collection:

opener.document .images['Image3'].src = 'insect.jpg'

--
Rob

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1689
by: J. Black | last post by:
Hello everyone - I've been developing an incident tracking and reporting system for an emergency services outfit that I work with part time. It's going well, except for one fly in the ointment. The situation is this - I have a dispatch form that is used by dispatchers to track incidents. An incident number is automatically assigned...
13
2341
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't reached yet (I have gone all the way to page 50 on Google's results!!). Here are my requirements: • I have a DataGrid. Everything will be done from...
4
3062
by: cjaserver | last post by:
This works fine in IE, but is breaking in Firefox, and reported in Netscape as well. I can't determine why. http://www.chartermainstreetgld.com click on the real estate section on the left nav area. You can see where the green real estate image is being moved down a line in firefox, where IE displays it correctly.
8
2335
by: Cardman | last post by:
I am hopeful that someone can quickly solve my image alignment issue when things are just not going right and where my attempts to solve this alignment issue have all failed. First of all take a look here... http://www.cardman.com/switches.html In MIE this page looks perfect. Unfortunately both Netscape and Opera show these item photos...
3
1756
by: Dave | last post by:
Hey all, I have a problem and I can't find anything on the net to really address it. We have a program at work that has lots of numbers on the front of the form because it is a control program for a hydro plant. My boss would like me to create a web page so our control center can see all of the numbers but not have access to the actual...
2
3827
by: Tom | last post by:
I need to be able to reference some images stored in my VB.NET program. Normally, I would load the images into an ImageList control and use them from there (these are going to be icons). However, I need to be able to add/delete images from this image 'store' (whatever I end up using); but because an image list only allows referencing by image...
3
21249
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image' src='picture.gif' name='myimage' id='myimage'> </form> When forms with image types are submitted, the value is not returned; instead, when the form is submitted,...
8
2138
by: Fred | last post by:
Hi People, I have a bit of a problem on my hands and wondered if anyone here has done anything similar! I have a VB6 application that displays an image stored locally (all easy stuff so far). However I want to store images from all offices across the country in a central location and then if someone from one office goes into another I...
0
7860
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8139
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6546
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3799
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3813
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1398
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1127
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.