alex
Jan 11 2002, 05:57 AM
Have you tried putting post in the 'value' attribute? This is what I've used succesfully on other sites (granted not in MT) and it has always worked. I think that the lack of "value='submit'" forces the button to use a default state of 'submit'.
CODE
<input type=image src="/images/submit.gif" name="hidden_Submit" alt="Submit" border="0" value="Submit">
Depending on whether or not you want to support older browsers (4.x and below) you could use:
CODE
<button name="mybutton" value="Post Me!" type="submit"></button>
The button tag is in the specs and can be fully customized by CSS. Again, I haven't utilized this in MT as of yet.
Hope this helps,
kadyellebee
Mar 14 2002, 06:46 PM
You might want to check out how Robyn at
Ain't Too Proud to Blog does it - I know that she uses images to submit her comments.

Kristine
btrott
Mar 14 2002, 11:12 PM
The name of the form input tag needs to be "post"--is it?
CODE
<input type="image" src="/images/submit.gif" name="post" border="0">
And if you use an image for Preview, the "name" has to be "preview".
brenmae
Mar 17 2002, 07:46 AM
Hi Ben and everyone,
I've tried my best to tweak the template to make this work, but without success. Is there any solution to this problem or should i just leave it be? Just want to know so that i can finally move on! ???
annabel
May 14 2002, 07:23 PM
QUOTE
So... since there isn't a form param named post, the system isn't registering it as a post attempt.
You could hack mt-comments.cgi to look for 'post.x' instead of 'post'.
i can't see the word "post" anywhere in mt-comments.cgi.
where should i be looking?
ewingren
Jun 24 2002, 05:58 PM
QUOTE
Ben:
yes it is.
this is what i have in my individual archive template:
CODE
<input type="image" name=post src="../img/smile.gif" border="0">
everything works as per normal if i use a normal "submit" button. it was only until i changed it to use an image instead that the problem occured.
maybe if you put " around the name value -> "post"
ewingren
Jun 24 2002, 09:42 PM
ok. i'm stuck. trying to use images in the place of the POST, PREVIEW and CANCEL buttons.
ben's suggestion:
CODE
<input type="image" src="/images/submit.gif" name="post" border="0">
...does not do the trick. the image shows allright and when clicked it *seems* like it calls the right script but nothing new is created. am i missing something?
guillebe, does your suggestion to hack /lib/MT/App/Comments.pm apply to anyone who want's to use an image as a button or is it for brenmae's case only?
pandemonia
Jan 10 2002, 10:05 AM
Hello everyone...
I'm being successful in modding MT so far, but i just encountered a small issue.
I'm trying to change the default " POST " button in the submit comments form to an image with the usual html (input type=image name=post src=...), but with no success. instead of actually posting the data, the user is redirected to a page with all comments for the entry.
I tried the names "post" and "submit" for the image, but with no success.
If anyone has any suggestions, please help me. My head is tired from too much MT'ing already
-- michell
brenmae
Mar 14 2002, 05:03 PM
sorry, i had to revive this topic. i'm having the very same problem, and there doesn't seem to be an obvious solution to this. can someone shed some more light on this matter?
brenmae
Mar 14 2002, 07:15 PM
thanks for the link, Kristine. i tried, i really tried to figure it out, but... i still can't. more suggestions?
brenmae
Mar 14 2002, 11:36 PM
Ben:
yes it is.
this is what i have in my individual archive template:
CODE
<input type="image" name=post src="../img/smile.gif" border="0">
everything works as per normal if i use a normal "submit" button. it was only until i changed it to use an image instead that the problem occured.
btrott
Mar 17 2002, 06:04 PM
Oh, I see why it doesn't work... when you click on an image submit in a form, the browser sends two form parameters, based on the name of the form input. So, for example, with a name="post", the two params would be post.x and post.y, corresponding to the spot on which you clicked on the image.
So... since there isn't a form param named post, the system isn't registering it as a post attempt.
You could hack mt-comments.cgi to look for 'post.x' instead of 'post'.
girlie
Mar 17 2002, 06:50 PM
I looked at Robyn's site (mentioned by Kristine above) and I noticed in her source code, she isn't using the name attribute, but is using the value attribute.
Hmmmmmmm.
richK
Jun 13 2002, 01:34 PM
You should be looking in mt/lib/MT/App/Comments.pm (lines 24-30ish).
guillebe
Jun 24 2002, 07:59 PM
look in /lib/MT/App/Comments.pm for the lines saying
CODE
if ($q->param('post')) {
and
CODE
} elsif ($q->param('preview')) {
change them to
CODE
if ($q->param('post') || $q->param('post.x') ) {
and
CODE
} elsif ($q->param('preview') || $q->param('preview.x')) {
respectively.
Works here.. is it ok, Ben? Perhaps it could make it to next revision
ewingren
Jun 24 2002, 10:48 PM
yes!
guillebe's hack works wonders!
thanx!
edb
Apr 14 2003, 01:41 PM
Ah, what a little searching turned up! Well it works wonderfully and much thanks to everyone for the hard work. My only question is, can the same be done (ie use an image as a button) for the type=button controls, "cancel" and "forget info" ? Thanks again!
demonsurfer
Jun 26 2004, 10:48 AM
should be a onClick submit line and a small javascript called..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.