views:

21

answers:

1

Hi,

I'm trying to add a pre-filled 'add reply' form to a view of nodes. Reply is a content-type (reply) with certain fields that need to be prefilled based on what is in the view. This way a user can see only the selected fields from the node/add/reply.

At the moment I'm building the forms manually - copy the form from node/add, do some modifications using php & views customfield, but I would like to be able to just push default values to some fields and hide some others and then make drupal render it with all the javascript glory like date select etc.

Can this be done?

A: 

How about using Form Block to place the node add form on a page in a block below a view.

About conditional defaults... I guess javascript.

doublejosh
You can also add AJAX views refresh in order to have the new content show up after submission.
doublejosh
I was thinking more about something similar to http://api.drupal.org/api/group/form/5 As I would like to also hide some settings which are unnecessary etc. and you can't do that with CSS as there are no unique id's for different div elements of the very complicated node/add.
niedakh
So your node/add/reply page has a block view on it? Weird, but actually great....and you want to place values form that view into the node add form?This is an interesting situation.But I'm still not sure how to move those values across other than javascript.
doublejosh
What I have is a view: propositions/%type which displays all propositions of a given type in a grid.I also have a content-type reply containing:- integer CCK field with time a person would administer to help- date CCK with time information- nodereference CCK to the propositionI want to be able to display underneath each proposition a form with a hidden field containing the id of the proposition for noderefence CCK and the other two fields rendered normally, without all the rest of the node/add garbage, so that a user can create a fast reply with a small form.
niedakh
I can do it with copypasting and modyfing the HTML behind node/add/reply, but it doesn't work with certain fields like the date, because it won't show a date picker. Similar for an autocrop image CCK, and that's why I need to be able to modify the original form, but use the drupal form engine to generate it. And I have found absolutely no hints on the net after two week googling.
niedakh
How about treating the replies as comments (seems like that's what they are.) This removes the need for the id reference (which should be a node reference anyway if you're going to do that.)Instead with the comment approach you can use http://drupal.org/project/nodecomment
doublejosh