I have a front-page where I'm loading the node of the form into the page like this:
<?php $node = node_load(5);
node_build_content($node, 'full');?>
<div class="modal hide fade" id="contact">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3><?php echo $node->title; ?></h3>
</div>
<div class="modal-body">
<?php echo render( $node->content ); ?>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
</div>
</div>
It's working fine as far as reloading the current page and submitting once the submit button is pressed, but the drupal_get_messages() is returning as blank. Does it set the message some other way that I can access in my php?
I tried loading it as a block with module_invoke and in that case it ignores the AJAX and goes right to the result page
Comments
Comment #1
David Stosik commentedHi,
I tried creating a PHP custom block using the exact same code (though I didn't include any of the modal behaviors you may use, as I don't know what you use).
After many teests, I can affirm that it works perfectly (well as good as on node/nid page, or in the block provided by Webform).
So the problem does not come from "loading the node through other page", put probably come from your modal system. During an AJAX callback, messages are returned in a JSON array, and are displayed by Javascript code (mainly ajax.js core file), so I suggest two things : first check that the Webform's HTML is not altered in any way that would harm AJAX system. Second, ensure that your modal system does not produce any Javascript error.
Feel free to feed me with more details.
Regards,
David