Forums / Developer / Adding javascript onchange to attribute_edit_gui
Kedar Deshpande
Monday 11 May 2009 12:26:40 pm
Is there a way to add attributes to a attribute_edit_gui call to provide an onchange call? I saw on the forums that there is an example of creating a call from a dropdown selection but it is not using the attribute_edit_gui operator.
http://ez.no/developer/forum/setup_design/adding_javascript_call_to_a_attribute_edit_gui_object
Current:
{attribute_edit_gui attribute_base=$attribute_base attribute=$attributes.item view_parameters=$view_parameters}
which produces source as:
<select id="ezcoa-423_lead_content_type" class="ezcc-cc_lead ezcca-cc_lead_lead_content_type" name="ContentObjectAttribute_ezselect_selected_array_3150[]" ><option value="0" >Image</option><option value="1" >Feed</option></select>
How/What can be passed to the attribute_edit_gui operator for the addition of onChange="javascript:func(this);" in the select statement?
thanks.
André R.
Monday 11 May 2009 12:31:34 pm
Override the template used by attribute_[edit|view]_gui (enable DebugOutput and ShowTemplates in site.ini to get the clues you need.) and make your custom template look for custom attribute_onchange variable if you need to define this in edit template.
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom
Monday 11 May 2009 12:40:04 pm
Thanks for the tip. I thought there might be a way to pass the needed fields into the existing operator, but making my own with the required values sounds good as well.
Thanks
Script start
Module start 'content'
Module end 'content'
Script end
Time used to render debug report: 0.0003 secs