By ltwinner on
I have a mytheme_comment_form(&$form) function to make some modifications to the comments form on my site. However when I change the value of the 'submit' item, like this $form['submit']['#value'] = 'Post comment';, the comment no longer submits, it just refreshes the current page as opposed to sumitting the comment and redirecting back to the node like it should.
Any ideas why this is happening?
Comments
Here's my
Here's my preprocess_comment_form function -
If I remove the
$form['submit']['#value'] = 'Post comment';it submits properly. Anybody got any ideas?I Use:
Wow, I answered something for once on drupal forums! Wooo! (hope Im right now...)
;]
I'm getting the same problem
I'm getting the same problem using similar code. When I submit the form, it takes me to "/comment/reply/nid".
Also like the OP, if i remove $form['submit']['#value'] = t('Post Comment'); it works normally.
Tried the suggestion above, but it doesn't work.
did you find a solution for
did you find a solution for this? i'm having the exact same problem
Nope, sorry.
Nope, sorry.
Has somebody found a solution
Has somebody found a solution for this in the meantime?
I used this mod to change the
I used this mod to change the 'Save' button text to 'Submit' - http://drupal.org/project/stringoverrides
However, this might be site wide.
Thanks for answering, but I
Thanks for answering, but I guess this would change all submit buttons, not only those on comment forms, right?
I solved the problem by writing a mini module implementing hook_form_alter() to get specifically the string of the comment form submit button altered:
nodeformsettings allows you
nodeformsettings allows you to change Submit (and much more) on Nodes and/or Comments on per-ContentType basis. May be overkill if your needs are very specific.
Is this a bug? Surely this
Is this a bug?
Surely this seems like the logical way to do this. But I'm having this problem as well now and it seems many others are too.
I'm experiencing exactly the
I'm experiencing exactly the same. It sounds like a bug.
Just for the record, I think this is the explanation
I copied this from https://drupal.org/node/140387 where mooffie explained that the right way to change text buttons is with form_alter, inside a module.
Cheers
This does it
For comment forms this seems to work in template.php
Worked
I know this is an old thread, but I was having the same problem and this solution worked for me.