You need to sign in to do that
Don't have an account?
Javascript events (onclick, onmouseover, etc) broken for SelectOption [bug]
I am having trouble adding javascript events to the individual selectOptions. I am able to add events to the wrapping selectList and selectCheckboxes.
Please see the following code example. The expected behavior when clicking on a selectOption would be:
- An alert from the surrounding selectList or selectCheckboxes
- An alert from clicking on each individual selectOptio, like "Click me 1"
I've inspected the HTML source and have confirmed that the onclick events do not get rendered. Has there been a bug filed against this?
<apex:form >
<apex:selectCheckboxes id="selectedCheckboxesId" layout="pageDirection" onclick="alert('clicked apex:selectCheckboxes')">
<apex:selectOption id="so00" itemValue="Click me 1" itemLabel="Click me 1" onclick="alert('Click me 1')" onmouseover="alert('Moused Over 1')"/>
<apex:selectOption id="so11" itemValue="Click me 2" itemLabel="Click me 2" onclick="alert('Click me 2')"/>
</apex:selectCheckboxes>
<apex:selectList id="selectedListId" onclick="alert('clicked selectList')">
<apex:selectOption id="so0" itemValue="Click me 1" itemLabel="Click me 1" onclick="alert('Click me 1')" onmouseover="alert('Moused Over 1')"/>
<apex:selectOption id="so1" itemValue="Click me 2" itemLabel="Click me 2" onclick="alert('Click me 2')"/>
</apex:selectList>
</apex:form>
I am still having this problem. Has anyone found a solution or work around to this problem?
I'm getting this issue as well anyone else found a solution?