Page 1 of 1

assign hidden value of field in db table to transient field?

PostPosted: Tue Jan 19, 2010 6:36 pm
by kevinwen
I have the following definition in fields.ini:

Code: Select all
[field_a]
widget:label = "URL"
widget:type = hidden
widget:atts:size=80
visibility:list = hidden
visibility:browse = hidden
group = sources
order = 38

[field_trans]
transient = 1
widget:label = "URL"
widget:type = text
widget:atts:value = "?"
visibility:list = hidden


The question mark is the value of field_a. What's the syntax in question mark to accomplish this task?

Re: assign hidden value of field in db table to transient field?

PostPosted: Mon Jan 25, 2010 11:08 am
by shannah
This is an interesting question. Essentially you're wanting to have a default value for your transient field that is the same as the value of another field.
What about using javascript for this?
Code: Select all
function block__after_field_trans_widget(){
       echo <<<END
<script type="text/javascript">
document.getElementById('field_trans').value = document.getElementById('field_a').value;

}
END;
}