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

A place for users and developers of the Xataface to discuss and receive support.

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

Postby kevinwen » Tue Jan 19, 2010 6:36 pm

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?
kevinwen
 
Posts: 109
Joined: Mon Dec 28, 2009 3:44 pm

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

Postby shannah » Mon Jan 25, 2010 11:08 am

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;
}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved