473,387 Members | 1,624 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,387 software developers and data experts.

Image visibility in IE

Greetings -

I am trying to set up a page where there are a couple of checkboxes, and
based on the selected checkbox, certain input fields are required. For the
required fields, I want to display a red asterick as an image (
required.jpg ) next to the field iteslf. Thus, I am trying to write a
JavaScript function that will get called via the "onchange" action for each
checkbox.... this function willl either set the visibility to "visible" or
"hidden" for the red asterick ( required.jpg ) next to each input ( name,
address, email, etc... ). I am able to get this working in Netscape (
7.02 ), however I can't seem to get it to work for Internet Explorer (
6.02 ).

Here is a trimmed down, working ( at least in Netscape ) sample of what I am
trying to do. Any idea on what I need to do differently to get this to work
in IE?

Any help is appreciated. Thanks,
Jusitn

---------------------------------------------------------------------
<html>
<head>
<title>Test</title>
<script language="JavaScript">
<!--
function updateReq( ) {
if( document.testForm.requireName.checked ) {
document.images.req_Name.style.visibility = "visible";
} else {
document.images.req_Name.style.visibility = "hidden";
}
}
//-->
</script>
</head>

<body>

<form name="testForm">
<input type="checkbox" name="requireName" onchange="javascript:
updateReq();" checked>Name Required
<br>
<img name="req_Name" id="req_Name"
src="includes/images/required.jpg">Name:<input name="Name" type="text"
size=25 maxlength=50>
</form>

</body>
</html>


Jul 20 '05 #1
2 5970
> Here is a trimmed down, working ( at least in Netscape ) sample of what I
am
trying to do. Any idea on what I need to do differently to get this to work in IE?
<input type="checkbox" name="requireName" onchange="javascript:
updateReq();" checked>Name Required


IE is not registering the onchange event for the checkbox. Onclick works
fine.

Jul 20 '05 #2
JW
onclick is what I needed....I must've had a brain fart there... thanks!

"Brett Merkey" <bm*****@tampabay.rr.com> wrote in message
news:Po*******************@twister.tampabay.rr.com ...
Here is a trimmed down, working ( at least in Netscape ) sample of what
I am
trying to do. Any idea on what I need to do differently to get this to

work
in IE?
<input type="checkbox" name="requireName" onchange="javascript:
updateReq();" checked>Name Required


IE is not registering the onchange event for the checkbox. Onclick works
fine.

Jul 20 '05 #3

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

Similar topics

2
by: e | last post by:
IE6. I have a form that can take a while to process once the user submits it. So upon submittal of the form, the onclick event for the submit button changes some text on the screen to say 'please...
12
by: Mark Anderson | last post by:
Even with preloading roll-overs etc, the first set of images used on screen still have to load before they can be seen. So, I've been asked I can to show a text message 'loading...' while a number...
3
by: Raed Sawalha | last post by:
Dear : I have an image in a aspx page I need when user mouseover it to display HTML Table with links. Regards
3
by: Mark Szlazak | last post by:
The following page simulates a pool cue and cue ball: http://members.aol.com/myscript/cue.html Mouse cursor position around the cue ball determines where a roll-over of 179 pool cue images is...
3
by: Andy Baxter | last post by:
I have an image scrolling in a viewport for a panoramic image viewer. The viewport can be resized to several set resolutions so people can adjust the size according to their bandwidth. There are...
2
by: spinow | last post by:
Hi there, My current project has a div with a table inside it. In this table I have a cell. In this cell images are loaded using a javascript function and the images are resized to fit the cell with...
10
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
8
by: Haines Brown | last post by:
I want a hot text string to display an image only when hovered. In the body: .... <a id="link-a" href="#nogo"> <img id="photo" src="..." />hot text </a> ....
4
by: 200dogz | last post by:
Hi guys, Just a quick and simple question: i'm trying to have a loading image displayed when a submit button is pressed. Basically what I have at this stage is an asp:image with its...
15
by: UberGirl | last post by:
Hi, I'm a novice... just trying figure out something simple, I'm sure. I've got a script within my <head> tags to show/hide divs on click: function showHide(divID, imgID){ if...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.