Menu

#91 readonlyin

open
nobody
None
5
2012-11-27
2012-08-17
Anonymous
No

Hello,

i suggest a feature, that those fields, which are readonly should still be saved to database, because they can get manipulated during changing of an asset by ajax. And also they are of type=hidden, so the values are there and can be changed with form_set_values.

i already wrote a function to change the visible text of fields like this:

<field simple_type=text.../>
<readonlyin...>
</field>

In bin/ext/js/functions_edit.js i add this function

function form_set_readonlytext(prefix,data) {
for (key in data) {
var laenge=data[key].length;
var text=data[key];
var obj=getObj(prefix+key+'_readonlytext');
if (obj.firstChild) obj.removeChild(obj.firstChild);
obj.appendChild(document.createTextNode(text));
}}

This function works if u add <span> tags around the text in bin/templates/helper/form_fields.tpl in line 96:

<span id="{$item_name}_readonlytext">{$item_value|default:$item.DATA[0]}</span>

Can u assist me, where i can change the behaviour, that "readonly" fields wont get saved when an asset is saved?

Regards

Christian

Discussion


Log in to post a comment.