473,396 Members | 2,014 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,396 software developers and data experts.

Pb with javascript function in Safari

Hi,
I use this function in my website, it works perfectly in Firefox. Whan
I click on the image, it changes the border and selects the button
asociated (it's a radiobutton). the color of the border is the text
color of the table.
In IE, the click on the image isn't working (no button selection). If I
click the button, the color of the border is not good.
In Safari, nothing is working.
Any ideas ?

function changeborder(numero)
{
for(var i=1;i<12;i++)
{
if (i!=numero)
{
eval ('document.form1.image'+i+'.border=0');
}

else eval ('document.form1.image'+i+'.border=10');
}
}

Html Code

<label>
<input name="Yunomi" type="radio" value="1"
onclick="changeborder(1)"/>
<img src="Photos/GIF/image1.gif" name="image1"
width="472" height="118" align="middle" id="image1"/>
</label>

Mathieu

Jan 11 '07 #1
3 1337
le***@attglobal.net wrote:

nothing is working.
Any ideas ?

function changeborder(numero)
{
for(var i=1;i<12;i++)
{
if (i!=numero)
{
eval ('document.form1.image'+i+'.border=0');
function changeborder(numero){
for(var i=1;i<12;i++){
document.getElementById("image"+i).style.border=
i==numero?
"thick solid #0000FF":"none";
}
}

Mick

Html Code

<label>
<input name="Yunomi" type="radio" value="1"
onclick="changeborder(1)"/>
<img src="Photos/GIF/image1.gif" name="image1"
width="472" height="118" align="middle" id="image1"/>
</label>

Mathieu
Jan 11 '07 #2
Mick, you again !! :)

Thanks a lot.

If i put 'document....' after the onclik it works perfectly.
But the function does'nt work...
The other pb I have in IE is that if i click on the image it doesn't
change the button value.
I have to select the button by clicking on the button. I want to select
the button by clicking on the image...

HELP !! ;)

Mathieu

Jan 11 '07 #3

It's ok mick, i solved this :)

thanks again

Jan 12 '07 #4

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

Similar topics

3
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created...
7
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the...
7
by: petermichaux | last post by:
Hi, I have tried the following based on suggestions of the best way to insert JavaScript into a page. This is instead of using eval(). Unfortunately IE says "unexpected call to property or...
14
by: maidane | last post by:
Hi, I got the following situation using the AC_Quicktime library. Apple recommend to use a Javascript call to generate the OBJECT tag (http://developer.apple.com/internet/ieembedprep.html). I...
3
by: Arodicus | last post by:
This is bugging me: how do I reference the topmost node (HTML) within a document? I'd like to set a class on it, which specifies various browser/os/versions so that several...
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.