By gmclelland on
I have two content types criminal and offense. The offense content type has a node reference field (it's a select box) called "criminal's name". I am using the editablefields module to edit the criminal's offenses on the criminal's edit page.
How can I set the default field value of the "criminal's name" node reference field equal to the value of the criminal currently being edited?
This would keep the user from having to manually choose the criminal's name when editing an offense or adding a new offense.
Thanks for your help,
Glenn
Comments
using php to grab default values
You can use php to grab the query string, and if required do db queries to pull down the criminals name. It's a bit more complicated, but with a bit experimentation with cck you should be able to see the results in your forms.
--
OpenConcept | SEO | Tech | Screencasts
Could you give me an example
Could you give me an example of the code you would use to do this?
It say's to use this format:
array(
0 => array('nid' => value for nid),
// You'll usually want to stop here. Provide more values
// if you want your 'default value' to be multi-valued :
1 => array('nid' => value for nid),
2 => ...
);
but where do I find the values to replace 'nid'?
I haven't yet played with devel module. Maybe that's where I would find my answer.
Thanks for your help,
Glenn