By web2 on
Hi,
I want to display Create content poll form in block.
I found your link while i am trying to produce form for Create content poll and I think you can help me.
I write form codes manually but I stuck with data validation error for form_token. I write php code for it which i found in forum and same error again . The codes are here :-
<form action="/?q=node/add/poll" method="post" id="node-form" enctype="multipart/form-data">
<div>
<div class="node-form">
<div class="standard">
<input class="autocomplete" type="hidden" id="edit-taxonomy-tags-1-autocomplete" value="http://tveed.com/?q=taxonomy/autocomplete/1" disabled="disabled" />
<div class="form-item">
<input type="text" maxlength="128" name="title" id="edit-title" size="60" value="" class="form-text required" />
</div>
<div class="form-item">
<label for="edit-taxonomy-tags-1">Category of TV Shows: <span class="form-required" title="This field is required.">*</span></label>
<input type="text" maxlength="255" name="taxonomy[tags][1]" id="edit-taxonomy-tags-1" size="60" value="" class="form-text form-autocomplete required" />
<div class="description">A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".</div>
</div>
<input type="hidden" name="changed" id="edit-changed" value="" />
<input type="hidden" name="choices" id="edit-choices" value="2" />
<div class="form-item">
<input type="hidden" maxlength="128" name="choice[0][chtext]" id="edit-choice-0-chtext" size="60" value="Yes" class="form-text" />
</div>
<div class="form-item">
<input type="hidden" maxlength="128" name="choice[1][chtext]" id="edit-choice-1-chtext" size="60" value="No" class="form-text" />
</div>
<input type="hidden" name="edit[form_token]" id="a-unique-id" value="<?php print drupal_get_token('poll-form'); ?>" />
<input type="hidden" name="form_id" id="poll-node-form" value="poll_node_form" />
</div>
<input type="submit" name="op" id="edit-submit" value="Submit" class="form-submit" />
</div>
</div></form>
I also try to call drupal form function in block but fail :-
<?php
$output = drupal_get_form('advpoll_form');
print $output;
?>I still struggle for success. Please help me.
Visit me at http://nashikit.com
Comments
I get success. cheers
Hi,
I get success with the codes
I want to more help regarding to poll edit form.
Can I provide default choice option for poll? which mean I want fix options 'Yes' and 'No' for choice for every poll created by users.
Visit me at http://nashikit.com