473,836 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML Select, OnChange on <option>?

@sh
Hi guys,

As far as I understand it, there is no possible way to add an
OnSelect/Onchange to an actual <option> within a select tag (to perhaps jump
to a page or run a DOM command), is this still correct with modern client
browser advances (obviously taking into account the incompatibiliti es of
this method with older browsers).

Cheers, Ash
Jul 23 '05 #1
2 9968
@sh wrote:
As far as I understand it, there is no possible way to add an
OnSelect/Onchange to an actual <option> within a select tag


Use the select element's onchange handler and it's selectedIndex
property instead.

ciao, dhgm
Jul 23 '05 #2
@sh
"Dietmar Meier" <us************ ***@innoline-systemtechnik.d e> wrote in
message news:3d******** *****@individua l.net...
@sh wrote:
As far as I understand it, there is no possible way to add an
OnSelect/Onchange to an actual <option> within a select tag


Use the select element's onchange handler and it's selectedIndex
property instead.

ciao, dhgm


Ahhhh ok cool, shame its not a little simpler though and accessible directly
from the <option> tag.

Cheers, Ash
Jul 23 '05 #3

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

Similar topics

6
1513
by: George Hester | last post by:
What's this? IE has a simple way using an ActiveX object so that I can load a text file into the <OPTION>s like a database. It is called Tabular Control. But I doubt this is going to work with Netscape. What to do? -- George Hester __________________________________
1
1999
by: Robert Kattke | last post by:
I'm designing a site for local music and entertertainment and have a few ?s that need to be cleared up. Currently, I'm working on the Club part and have a Contact Person form, and a Club form. For the Club form, I'd like to have up to 4 Contacts with various roles, {Booking, Manager, Owner, All}. Ideally, I'd like to have a frameset and have Contact form filled out 1st, allowing me to set a cookie that would populate the...
1
1289
by: Raterus | last post by:
Hi there, Should I be concerned with a malicious user spoofing a postback by changing the values for a control like the dropdownlist found in the rendered <option> tags. I would hope asp.net would bomb on them if the value they posted was never a listitem in the control. Here's another question/situation though, what if the listitems in the codebehind were just "visible=false", could a user potentially trick a dropdownbox into acting like...
6
13034
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this is not an ASP.NET related question, but I know this group is knowledgeable and quick with responses. Thanks
5
1383
by: Cylix | last post by:
My code works under MS IE6, but not work on Firefox and Mac IE5.1.2 Mac IE5.1.2 response: 'options' is not an object function to check leap year Source code: -------------------------------------------------------------------- function setStartDayOpt() { var year = document.getElementById('startYear'); var month = document.getElementById('StartMonth');
7
6833
by: Shrek | last post by:
I have a drop down on a web page and want to change the cursor from default to pointer, so my style definition has style ="cursor: pointer;" the drop down though fails to change from the default curor. I've tryed applying the style to the <select> tag and to the <option> tags to no avail.
9
3686
by: Man-wai Chang | last post by:
For a form POST, what's the difference between: 1. <option</option> 2. <option>&nbsp;</option> -- iTech Consulting Services Limited Expert in ePOS (Point-Of-Sales) solutions Website: http://www.itech.com.hk (IE only) Tel: (852)2325 3883 Fax: (852)2325 8288
3
1566
by: ganeshp | last post by:
#include<iostream> #include<vector> using namespace std; class option { };
14
9278
by: The Natural Philosopher | last post by:
This is a nasty one and I can't see my way out of it. I have a bunch of select statements in a form, and each select statement has an onchange="do_something(this)" in it, and this works nicely..except when there is only ONE OPTION in a given select. It seems you cannot 'onchange' a single option! Well, that is reasonable. The trouble is I have no way of selecting it since the form itself is a
0
9673
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10560
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10602
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10260
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7795
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6984
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.