cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart Thorne" <>
Subject RE: CForms: conditional display of widgets
Date Wed, 07 Jun 2006 11:45:40 GMT
You could use client-side JavaScript?
Add an onkeypress / onclick event on your drop-down menu, which triggers
a JavaScript 'show / hide' function.
The JavaScript 'show / hide' function on changing the drop-down value
should set the CSS property for your dynamic widget to be displayed as
{display:none} / {display:block or inline}
For Accessibility:
By default the CSS display property for the dynamic widget should be set
to display:block / inline.
Then use the JavaScript document.write to write out the display on the
rendered html page as {display:none}, for the dynamic widget. That way
if the web user does not have JavaScript available / enabled, your
dynamic field will appear by default.
Hope this helps,


	Sent: 07 June 2006 12:31
	Subject: CForms: conditional display of widgets

	How can I do to display a certain widget in a form only if a
specific condition is met?


	Depending on the value of a drop-down menu in the form, another
widget should be displayed or not,

	dynamically, not only when the form is first presented.



View raw message