Log
Using Images for Movable Type Comment Form Buttons
I had some trouble finding any information on using input type="image" with Movable Type’s comment forms, so here are my insights.
It seems that if you submit the form to mt-comments.cgi without explicitly assigning the value “post” to the variable post or the value “preview” to the variable preview, the comment info doesn’t do anything. This is a problem because the image buttons don’t pass their values to the script.
Now, you could use javascript to set the variables, but if javascript is disabled, comments just don’t work. So, the solution is to remove the preview option, and to use a hidden input element: <input type="hidden" name="post" value="post" />. The image button submits the form, the hidden input passes the correct value and everything works great.
05/25/03 09:02PM Geekiness
Comments
The comment box don’t like me it seems. :)
I’ve pasted the code earlier and if I replace post with preview, the form is still not assigning value to the variable.
Besides removing the preview button, are there any other alternatives?
02/18/04 10:55PM
Verced: I fixed the html in your comment with encoded brackets—it got stripped out.
The reason I’m not using the preview is that it requires javascript to work and I couldn’t figure out any other way to do it. That’s not to say that there’s no way to do it, I just gave up trying and settled for what seemed like the best solution.
02/19/04 8:12AM
thank you!
after much head-scratching and looking around, i found your solution and it solved the problem perfectly :D
05/08/04 5:43PM
Great info, thanks!
02/04/05 10:12PM
Great stuff. Thanks for this tip.
08/18/05 8:00PM
Add a Comment
Have something to say about what I wrote here? Let’s hear it!
- Your name and email address are required, but your email will not be displayed on the site
- If you provide a URL, a link to your site will appear
- You may use the following HTML:
<strong>bold</strong><em>italic</em><a href="http://url">links</a>
- Double line breaks will be converted to paragraphs.
- As you type, you should get a nice little preview of your comment directly below the text box.
- I reserve the right to edit any comment for any reason (I’ll be reasonable).
Recently Played on iTunes
-
“Heroin”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:26 -
“All Tomorrow's Parties”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:20 -
“Run Run Run”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:16
Verced:
If this <input type="hidden" name="post" value="post" /> sets the value of post, why doesn’t <input type="hidden" name="preview" value="preview" /> this works?
02/18/04 10:52PM