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

onChange() event of input type select is not working in MAC safari

hi friends,
can anyone tell me why onchange() event input type select is not working in MAC safari. is there any alternative of this problem.

i have written the following code :


<Select name="adultcolor" onChange ="CheckColor('adultcolor');">
//code is removed for simplicity.
</SELECT>

here when i am changing the combo(adultcolor) value the checkcolor function is not called.

please help me out for this problem

thanks in advance
Jun 25 '07 #1
5 17555
shoonya
161 100+
use onclick

shoonya
Jun 25 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

im sure that onchange works with select-boxes in safari (i use it myself) ... try an alert instead of your checkfunction and change the value of the box ... that means ... select an other value as the one that is displayed first ... the alert should appear ... typically you have to write the handlers in lowercase ... try it ... i try it this evening too ... but i'm quite sure that it works ...

kind regards ...
Jun 25 '07 #3
gits
5,390 Expert Mod 4TB
the following works in safari ...

[HTML]<select onchange="alert(this.value);">
<option value="1">1</option>
<option value="2">2</option>
</select>
[/HTML]

kind regards ...
Jun 25 '07 #4
shoonya
161 100+
but this code has a problem
when you a select the default value then it wont give alert

in this case if you click on drop down and select 1 it wont give ou an alert..

shoonya
Jun 26 '07 #5
gits
5,390 Expert Mod 4TB
thats right ... the event is called onchange ... and so it fires on changing ;) typically we create an init method that calls everything that has to be initialized with a default value ... when using onclick the event fires without changing, thus call the handler when it is not needed ... but: you are right ... if you want it to be called everytime the user clicks the control ... you have to use onclick :: note: typically with ajax you do a request with the selected value ... and you needn't when you have the ui initialized and nothing is changing in an dropdown-list ... so avoid requests (and/or useless operations) wherever you can ... this is a rule of thumb ... so - there is no problem with the code ... its a question what purpose is to be achieved ... and: the question was about onchange with select in safari - and that works ...

kind regards ...
Jun 26 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
3
by: Lee Mundie | last post by:
Hi there, Simple problem here but can't seem to fix it! Okay, I have a select list from which people choose avatars... the list is option values ie. <option>Worm</option> ...
2
by: Asit | last post by:
In JavaScripts checks for an onChange event against the value of the textbox at the time of the last onChange event. Since an onChange Event never fired after you changed the text first time ,...
1
by: John Pastrovick | last post by:
Is there a way to load an image locally (in the client) when a selection of a file is made using input type=file. The purpose is to allow selection of a file and put the image in the browser...
1
by: SimonFx | last post by:
Am I right in assuming that you can NOT set focus() back to a field in its onChange event? Is there another way - I have validation that I would like to set the focus back to the invalid field...
4
by: David McNerney | last post by:
Would anyone be able to tell me why I get an error in FireFox 1.5.0.1 for MacOSX when I type some text and hit Enter in the following form: <html> <body> <form action="http://example.com"...
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
1
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/scripts/demo/select.html When I select an item from the drop down menu, with the mouse, that selection appears in the div section below. When, however, I double...
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
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
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.