Other Entries

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

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

Verced:

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

Chris:

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

kemie:

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

Ed:

Great info, thanks!

02/04/05 10:12PM

Dennis:

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!

The Rules

Personal Information




Remember Information


Comment Preview

 

 

Recently Played on iTunes

  1. “Heroin”
    The Velvet Underground & Nico
    The Velvet Underground
    11/17/08 16:26
  2. “All Tomorrow's Parties”
    The Velvet Underground & Nico
    The Velvet Underground
    11/17/08 16:20
  3. “Run Run Run”
    The Velvet Underground & Nico
    The Velvet Underground
    11/17/08 16:16

Last 100 Songs >