aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes how to get image input element on a form in Netscape? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "how to get image input element on a form in Netscape?" Watch "how to get image input element on a form in Netscape?" New topic
Author

how to get image input element on a form in Netscape?

lily zou
Ranch Hand

Joined: Jan 15, 2002
Posts: 50
I have a form and there is element on it like:
<input type="image" name="ABC" src="/ABC" alt="A"/>
In javascript, I could use document.getElementById("ABC") to get this element and do things to it when I use Explorer .
However, I cann't access it when I use Netscape by any means. I used document.froms[0] to iterate but could not find it, neither when I use document.images.
Is there any one who knows why and how ?
Thanks in advance,
Lily
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
document.FormName.ElementName.src="blah"
document.forms[0].ElementName.src="blah"
lily zou
Ranch Hand

Joined: Jan 15, 2002
Posts: 50
Thanks Eric but I tried that already. It backs me message "undefinied ".
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50677

Assuming that when you say "Netscape" you are talking about a modern version, be sure to put the id="elementName" attribute on the element you are trying to fetch with getElementById.
IE allows you to reference the element by its "name" attribute when using getElementbyId, but it shouldn't. Name and id are not the same.
hth,
bear


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
IntelliJ Java IDE
 
subject: how to get image input element on a form in Netscape?
 
Threads others viewed
About form submission
Image as Form title
Potential problems with getImage()
Form submit in Href
How to avoid submitting html input type image coordinates to server
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture