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

onChange doesn't (always) work

3
this piece of code works, the function daysCheck() can be found in a seperate js file included in the head.
Expand|Select|Wrap|Line Numbers
  1. <select id="month" name="month" class="dateselect" onChange="daysCheck()">
  2.     <option ...
  3.     ...</option>
  4. </select>
  5.  
  6. <select id="year" name="year" class="dateselector" onChange="daysCheck()">
  7.     <option ...
  8.     ...</option>
  9. </select>
a bit further in the file this piece of code can be found.
Expand|Select|Wrap|Line Numbers
  1. <select id="soort" name="soort" onChange="soort()">
  2.     <option disabled="disabled">...</option>
  3.     <option ...
  4.     ...</option>
  5. </select>
And this doesn't work, the function soort() can be found in the same file as daysCheck().
soort() looks like: (just for testing)
Expand|Select|Wrap|Line Numbers
  1. function soort()
  2. {
  3.     alert('hello');
  4. }
on the other hand if I do this it does give the alert.
Expand|Select|Wrap|Line Numbers
  1. <select id="soort" name="soort" onChange="alert('hello')">
  2.     <option disabled="disabled">...</option>
  3.     <option ...
  4.      ...</option>
  5. </select>
note that the select elements can be found in the same (and only) form on the page. And that the very first piece of code is generated with php. I tried different browsers (IE, FF, chrome, safari) and none of them works.
May 15 '10 #1

✓ answered by rienc

ok, wierd...
I have been looking for the source of this problem for a day or so, if I change the name of the function soort() to soortCheck() there seems to be no problem. Does anyone know what may cause this?

4 1798
Dormilich
8,658 Expert Mod 8TB
in the second <select>, are all <option>s disabled?
May 15 '10 #2
rienc
3
@Dormilich
no, just the first one, there are 6 other <option>s.
May 15 '10 #3
rienc
3
ok, wierd...
I have been looking for the source of this problem for a day or so, if I change the name of the function soort() to soortCheck() there seems to be no problem. Does anyone know what may cause this?
May 15 '10 #4
acoder
16,027 Expert Mod 8TB
Because you have an ID and name of the same name, so what you've posted is the solution to your problem.
May 15 '10 #5

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

Similar topics

2
by: Jeffry van de Vuurst | last post by:
Hi, I have a windows forms application. I've made a .chm help file and call that help file from my windows app using the HelpProvider component. I use F1 to show the context sensitive help for a...
0
by: pagates | last post by:
Hi Gurus, I am having a problem using Xml Serialization - it seems to work only the second time I try to use it during runtime. Here's a simplified example (the project is roughly equivalent...
2
by: Arne | last post by:
I have problems aligning my left menu with the valign=top: http://test.unitedhardware.com/valign.html It happens a lot when the the middle pane is very complicated with a lot of nested tables. ...
2
by: Arne | last post by:
I have problems aligning my left menu with the valign=top: http://test.unitedhardware.com/valign.html It happens a lot when the the middle pane is very complicated with a lot of nested tables. ...
3
by: Phil Galey | last post by:
I have a VB.NET application that uses SendKeys to close the open document in QuarkXPress 5.0 I'm using the following commands: AppActivate(QXP_Process_ID) SendKeys.SendWait("^{F4}") in an...
0
by: jonefer | last post by:
Private Sub txtLastName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLastName.TextChanged If Me.cmdAction.Text = "Update" Then Me.cmdAction.Enabled = True...
7
by: gmax2006 | last post by:
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys
3
by: annoula | last post by:
Hello, I'm sorry if this has come up before but I haven't been able to find a solution in any forum so far. I have a page with 2 forms. One form contains links that the user clicks to navigate...
0
by: jxt1303 | last post by:
I've created an Access 2007 application that has linked tables in a SharePoint 2007 site. Normally, after I open the app and access a form that uses one of these linked tables, you are prompted for...
15
by: colyn7 | last post by:
I really can't see what's wrong in my code... the submit() onChange doesn't work.. I've tried.. <select name="ddlTestCenter" id="ddlTestCenter" style="width:180px"...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.