Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-07 21:44:25

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

How can I set values for comment inputs?

I’m working on a site that uses ign_password_protect to distinguish between users who are logged in and those who are not. For logged in users, I want to pre-populate the comment form data so they needn’t enter their name and eMail address again. If I could add a value attribute to the comment input fields, I could place the ign_user_info tags there, but the comment inputs don’t take any attributes.

Thanks!

Offline

#2 2009-08-07 22:08:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: How can I set values for comment inputs?

johnstephens wrote:

I want to pre-populate the comment form data so they needn’t enter their name and eMail address again

Funny, I had exactly the same requirement recently. Never solved it and gave up trying. Thinking about it again, could you use a couple of lines of jQuery to read the ign_cookie and throw the useful bits it in the relevant input boxes? Not sure if that’d work but it might.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#3 2009-08-09 18:25:03

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: How can I set values for comment inputs?

I’m not completely there yet, but rah_comment_form goes ninety percent of the distance ! All i need is to get it to use the ign_user’s realname instead of the user id, and to allow optional input for a URL.

Offline

#4 2009-08-10 02:53:17

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: How can I set values for comment inputs?

I just realized this problem may have a very simple solution that blindly overlooked: Use input elements rather than txp:comment input tags! I’ve done this before for search, and I can’t think of any reason it won’t work in my comment form. I’ll try it out tomorrow. Thanks again!

Offline

Board footer

Powered by FluxBB