cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan McLean" <>
Subject Getting text value from dropdown list in form
Date Thu, 16 Feb 2006 11:29:18 GMT

I have a form definition which contains the following test selection list

<fd:field id="prodType" required="true">
	<fd:label>Type of product:</fd:label>
	<fd:datatype base="string"/>
		<fd:item value="val1">
			<fd:label>Text 1</fd:label>
		<fd:item value="val2">
			<fd:label>Text 2</fd:label>
		<fd:item value="val3">
			<fd:label>Text 3</fd:label>
			var value = event.source.value;
			var myTextField = event.source.lookupWidget("../myTextField");

I want to be able to write out the text of the selected list to a hidden
field (in the case "myTextField") when the value changes.

Currently the code takes the value - so if I select Text 2 for instance,
it writes out "val2" to the hidden field (obviously because of:
var value = event.source.value;).

Can I capture the text in the dropdown list in a similar way so, as per
the example above, "Text 2" gets written to the hidden field no "val2"?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message