Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-14 03:36:36

coffeepostal
Member
From: Anacortes, WA
Registered: 2005-09-06
Posts: 22
Website

Comment Form Manipulation

Hi-

I’m wanting to change the preview and submit buttons in the comment form from “input type=‘submit’” tags to “button type=‘submit’” tags (if you’re unfamiliar with what I’m talking about Particle Tree has a good article about it here )

I know enough PHP to make me dangerous, and in PHP file /textpattern/publish/comment.php, I’m seeing that the way the forms are generated are by an array, which suggests this may be really difficult. I’d like to stylize my buttons and this is the biggest hurdle. Any and all help would be much appreciated!

Offline

#2 2007-12-14 05:15:14

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: Comment Form Manipulation

I think I had a similar desire and I was able to use type=“image” instead of type=“submit” in my comment form.

Basically, I found that you need to use the txp tags for comment form building except for the preview/submit buttons. It’s possible to use HTML instead. Start by seeing the resulting HTML code from the txp tags: txp:comment_preview and txp:comment_submit. Use that HTML instead of the tags and then modify as you like.

This is what mine looks like:

<txp:if_comments_preview>
<input type=“image” name=“submit” src=“btn-form-submit.gif” value=“submit” alt=“submit” title=“submit” class=“button” />
<txp:else />
<input type=“image” name=“submit” src=“btn-form-submit-inactive.gif” value=“submit” alt=“submit” title=“submit” class=“button” disabled=“disabled” />
</txp:if_comments_preview>
<input type=“image” name=“preview” src=“btn-form-preview.gif” value=“Preview” alt=“preview” title=“preview” class=“button” />

If there is a better way, please let me know.

Last edited by typeshige (2007-12-14 05:20:49)

Offline

#3 2007-12-19 08:16:05

coffeepostal
Member
From: Anacortes, WA
Registered: 2005-09-06
Posts: 22
Website

Re: Comment Form Manipulation

Yeah, that makes sense, I’m not sure why I didn’t think of that before. Thanks!

Offline

Board footer

Powered by FluxBB