By melban on
I'm using a custom content type with additional CCK based fields. I'm using a 'Create New Game' link on my page that will use AJAX to pull the content form and display it on the page. I have this need as my CCK fields will display select lists determined by the page that calls the form via AJAX. (Page X needs select options 1-4 and Page Y needs select options 5-8).
My problem with that when calling drupal_get_form( "MY_CUSTOM_FORM_FUNCTION" ) it only returns the fields I have in my custom content type. It does not include the CCK fields I've added to my content type.
Does anyone know how I can go about having it load all the CCK fields without actually calling the page 'node/type/add'
Comments
well I have no idea what
well I have no idea what "MY_CUSTOM_FORM_FUNCTION" means, you could probably get much better help if you used real code samples.
to put a page form:
etc..
CCK fields wanted when calling drupal_get_form()
Regular node/game/add form displays CCK fields
http://www.smwebdesigns.com/lj/maven.drupal_get_form.png
Trying to pull the form using AJAX only displays hook_form() fields.
http://www.smwebdesigns.com/lj/maven.ajax.drupal_get_form.png
You need to use the form for
You need to use the form for adding/editing a node, your form represents just part of the question.
There is an alternative to using AJAX.
Lets say your content type is 'maven_game', the default path for adding content of this type would be node/add/maven_game, but something like node/add/maven_game/123 also works. The 123 is ignored by default but your code can use arg(3) to retrieve it (node would be arg(0), etc).
that will work
my whole issue was wanting to control what select values showed on a CCK field by passing something from the form page to that PHP Code field was my overall objective.
Thanks for the solution.