1283 Posts
Bucklash
8 years ago
0
Topic

Hi folks, 

EDIT: Since posting this question I have worked out a solution to part of my current journey... 

I was not using SD CCK LIve field correctly.

It needs to be separate from the content type it is pulling the value from (ie not in the same form)... otherwise you receive the error:

Oops! Template Init. failed..<br>

 I placed it in a new content type, placed that content type in a module, placed the module on the same page as the form, and voila!!!

My new trick is now to try and save the main content type form AND save the form in the module at the same time with only ONE click!!!

Wish me luck.


Original Post: Hi folks

I am trying to create a category and usergroup at the same time (I am trying to develop my Seblod skills).

So, in category content type I have:

user_group_title_backend

and

cat_title

For my form I want to fill in one input and have the other input dynamically filled with the same value.

ie field 'a' has value of 'poisson' entered by the user, and field 'b' receives the same value (poisson).

An example of what I am trying to achieve would be something like this (it is incorrect, but purely as an illustration):

$DuplicateValue = $fields['field_a']->value;
$fields['field_b']->value = $DuplicateValue;

I have used live values-> sql query, but that is to get values form the DB, isn't it?

sd live cck field creates an error (Oops! Template Init. failed..), the same as experienced by designbengel in her post:  prefill-form-module-with-variable-from-content-type

Anyway, each time I try with that I receive errors.

I have read various forum posts but I have not achieved success, only errors.

sql-query-field-retieving-values

sql-in-core-42

Any help would be superb

Jon

Get a Book for SEBLOD