We have a strange problem on a D6 site where currently the comment_form_validation code isn't being called at all on one particular blog post.
On this blog post there is an embedded form created by using this line: -
<?php print drupal_get_form('price_calculator_form','Live',true); ?>
If I remove the submit button from this embedded form, the comment validation works correctly. Here's the code for the submit button: -
<?php
$form['calculate'] = array(
'#type' => 'submit',
'#attributes' => array(
'class' => 'calculator-lookup-' . $index . " " . $buttonclasses),
'#value' => $buttontext,
'#weight' => 102,
);
?>I can't see anything wrong with this at all and it's just normal forms API stuff.
The problem can be seen here: -
http://www.first-utility.com/blog/3/only-smart-meters-have-answer
Like I say, comment validation works properly on any other blog posts, just not the one with the embedded form. On the broken page, comment preview still triggers the validation - just not the comment submit button.
I've checked the obvious things like duplicate IDs etc, but these all seem to be fine.
Thanks,
David
Comments
Comment #0.0
dubs commentedJust added in some better code tags