onchange - Input Change Script

Activates an event handler when a control loses focus and its value changed since last gaining focus.

Category

events

Syntax

<xp:eventHandler event="onchange" attributes>content</xp:eventHandler>

Usage

For detailed event handler syntax, see eventHandler - Event Handler (property).

Examples

This input box has a client handler for the onchange event. The client handler changes the value of the input box to upper case.
<xp:inputText id="inputText1" value="#{requestScope.status}">
	<xp:eventHandler event="onchange" submit="false">
		<xp:this.script>
			<![CDATA[var e = window.document.getElementById("#{id:inputText1}");
			e.value = e.value.toUpperCase()]]>
		</xp:this.script>
	</xp:eventHandler>
</xp:inputText>