Edit visualization - uppercase

Author Message

Lo' F.

Wednesday 27 April 2011 12:37:59 pm

Hi there,

In the user registration form I need to render an input field text in uppercase.

How can I pass the string upcase() function to the content object attribute on edit template visualization {attribute_edit_gui attribute=$attribute} ?

Many thanks!

loredanaebook.it

André R.

Thursday 28 April 2011 1:55:38 am

Override the attribute view for that specific attribute during editing using content/datatype/edit/*.tpl

But before you do that, if needed enable DebugOutput and ShowUsedTemplates to see which template is used. So you know which one to copy.

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

Lo' F.

Monday 30 May 2011 7:21:12 am

Hi! Sorry André, I let this topic behind some other jobs and only today I had the chance to go back to it.

Thank you, as always, for your precious hint.

- created an override for the edit view of ezstring.tpl datatype inside my extension

- then declaired the onkeyup event for the attribute_edit_gui this way

{default attribute_base='ContentObjectAttribute'
         ...
        onkeyup=false()}
<input ... {if $onkeyup} onkeyup="{$onkeyup}"{/if} />
{/default}

- and recalled the event within the attribute call

{attribute_edit_gui attribute=$attribute onkeyup="this.value=this.value.toUpperCase()"}

loredanaebook.it

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.