473,378 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

INPUT type=image

dwa
This is a bit off-topic, but...

Is it possible to write client side script that can address INPUT controls
with a type of "image" which will work under Netscape/Mozilla?

<INPUT type="image" ...>

Controls of this type are excluded from the forms[].elements collection and
'document.all[]' isn't supported my Mozilla browsers?

Any way to do this?

-- dwa
Nov 18 '05 #1
1 1499
Hi Dwa,

Thanks for posting in the community!
From your description, you'd like to address and do some operations on a
<input type=image..> control in a web page via client side javascript.
Also, you found that the "document.all" member isn't supported by Mozilla
explorer, yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my research, this problem does due to the different browsers have
different supports on the javascript apis, the "document.all" is not
supported in Mozilla, in Mozilla, we need to use the
"document.getElementById()" to get an page element by its id, and I've
tested using the below code in Mozilla 1.6, it worked well.
----------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title></title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<script language="javascript" >
function SetImgSrc(oid)
{
document.getElementById(oid).src =
'http://msdn.microsoft.com/library/mnp/2/gif/banner/bnr_msdn_LTR.gif';
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="500" align="center">
<tr>
<td>
<IMG id="imgImg" alt="MSDN"
src="http://msdn.microsoft.com/nodehomes/graphics/msdnevents.gif">
<input id="imgInput" type="image"
src="http://msdn.microsoft.com/nodehomes/graphics/msdnevents.gif">
</td>
</tr>
<tr>
<td>
<INPUT id="btnImg" type="button" value="Change Img's src"
onclick="SetImgSrc('imgImg')" >
<INPUT id="btnInput" type="button" value="Change input's src"
onclick="SetImgSrc('imgInput')" >
</td>
</tr>
</table>
</form>
</body>
</HTML>
---------------------------------------------
Please also try it out on your side to see whether it works. In addition,
here is a tech aritcle which has discussed on
how to set src attribute via clientside javascript under different browsers
such as IE, NETSCAPE, MOZILLA,:

#Extending setSrc() to Mozilla Browsers
http://www.webreference.com/js/tips/010126.html

I believe it also helpful to you.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2

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

Similar topics

1
by: Mark | last post by:
Hi, I create a button in the form in the asp page like is: <input type="image" src="button.gif" name="detail" border=0 value="100234"> How can I get this value from another page? I try sdetail...
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
1
by: Wayne | last post by:
Please help... For some odd reason onclick is not working with and <input type="image"> but works fine on an <input type="button">.... This does not work: <input TYPE="image" src="go.gif"...
2
by: Kimmo R. M. Hovi | last post by:
Currently I have defined: -- clip clip -- <form method="post" action="xx" enctype="application/x-www-form-urlencoded"> <input type="image" name="Function 1" src="image1.gif" border="0"...
1
by: Brian Genisio | last post by:
Hi all, I noticed that the image input type does not show up in the elements array (IE 6.0). <FORM name=myForm> <INPUT name=rads id=check1 type=radio value=val1> <INPUT name=rads id=check2...
7
by: b2b2u | last post by:
I can't seem to get a form to submit using an image !? <input type="image" src="submit.gif"> Any body have this problem? Is it choking on the x/y coordinates? If so, what can be done about it?...
1
by: champ.supernova | last post by:
Hi, I have a form which has a few different submit links, all of type image. This is critcal to the operation of the form, as it relies on the image co-ords being passed to another page, the...
2
by: jon | last post by:
Hi This might be an easy one to answer but I have a web form in an ASP.NET 1.1 application with a hand-rolled HTML image button as follows which opens a help guide in a new window: <input...
3
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'...
8
by: John | last post by:
Hi Pasrt of HTML - <div class='button'><input type='image' src='/images/check1.jpg'></input></div> Part of CSS - ..button {background-image: url(/images/check1.jpg); background-repeat:
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.