Contact Form - wishlist?

Creating and modifying plugins.
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Contact Form - wishlist?

Post by Don Chambers »

I would like to use the current contact form plugin as more of a registration form. The immediate implications are that 1) it will be the second instance of the contact form event plugin in my s9y install, and 2) the form will be considerably more detailed than the customary contact form.

I have installed the latest, greatest version, and had no problem adding it as a second event in the list of plugins.

Here is one tiny little change I did almost immediately.... I did not like the leading asterisk for required fields, especially when field labels were not completely left aligned when a field was not "required". Simple fix, make it a trailing asterisk, and change its color to draw additional attention to a required field. Just in case anyone is interested, in the plugin_dynamicform.tpl, I changed this:

Code: Select all

<td class="serendipity_commentsLabel">{if $field.required}<sup>*</sup>{/if}<label for="serendipity_commentform_{$field.id}">{$field.name}</label></td>
to this:

Code: Select all

<td class="serendipity_commentsLabel"><label for="serendipity_commentform_{$field.id}">{$field.name}</label>{if $field.required}<p class="serendipity_msg_important" style="display: inline"><sup>*</sup></p>{/if}</td>
Anyway, my requests are coming from the lmitation that 1) the contact form is essentially the comment form making certain changes to one affect the other (which might not be a good thing), and 2) Having 2 contact forms can lead to styling issues when the main contact form is preferable "as-is" yet a different look is desired for a considerably more detailed form. So, here we go:

1) Can we get an alternative title - like HTML head nugget - to differentiate more than one contact form event?

2) As in static pages, can we get an editable "Headline" and "Page title in Format as article mode", one of which would be the current default of "Contact Form" ($plugin_contactform_name???)? One (or both) of these fields, displayed on the plugin screen, would remove the need for my suggestion of "alternative title" above.

EDIT: The "headline" seems to be provided by the "URL Shorthand Name", so I guess I just need the ability to change the value of "Contact Form" for multiple instances of the plugin.

3) Larger/longer block for the form field string?

4) Preserve user supplied form field string even if user temporarily switches dynamic tpl template from dropdown list (ie, standard, detailed, small business, etc)?

5) Option to not display introductory text after form is submitted? (in other words, introductory text can look pretty silly, or take up valuable screen space when all you really need a user to see then is "Your message has been successfully mailed" (or whatever).

5b) Might also be nice to have an option to display the form results once submitted, much like a comment is displayed after it is posted.

6) User defined and savable template for standard, detailed, small business, others?

7) prevent PLUGIN_CONTACTFORM_DYNAMIC_ERROR_DATA from displaying when only the captcha is incorrect/missing.

8.) Related to 7 above, what is the advantage to having both the variables PLUGIN_CONTACTFORM_ERROR_DATA and PLUGIN_CONTACTFORM_DYNAMIC_ERROR_DATA? Seems the default for the latter is sufficient for both.

9) Related to Captchas in general - can there be some kind of "regenerate captcha" button for when the 1st one is simply too difficult to read?

10) Perhaps a user selectable option to send a copy of the form to themselves user via the email address they supply?

I may come up with others, but a few of these features would be great and would prevent me from taking a knife to the template - changes that would be lost when/if the plugin is updated in future releases.

So Garvin, can you get me this stuff in the next hour or so? :lol:
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Another thing - can we get a serendipity_commentsValue <label for....>blah blah </label> for a checkbox so that it can be styled by serendipity_commentsValue label {property: value;} the way the radio buttons are?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Contact Form - wishlist?

Post by garvinhicking »

Hi Owen!

I must admit that the contact form is not my pet peeve any more, but I will try to look into things for you.

1.) should be solvable fairly easy. I'd even drop in for you a config option to choose a different comment.tpl and plugin_contactform.tpl template (if that doesn'T exist already, I haven'T checked)

2.) Should be possible to distinct those, yes.

3.) This is a function of the central core, so I don'T know if it can be solved easily.

4.) Phew. This will be hard, I don't think I'll have a solution for that.

5.) Should be easy to add

5b) Should be doable, however that's some lines of code to check the results

6.) see 1.)

7.) What should be shown instead?

8.) I suppose this is a distinction between hard-coded fieldname errors and user-defined fieldname errors, so I'd leave that intact.

9.)Just right-click and instruct your browser to refresh the image? The problem is that this would require javascript, and I'd like to avoid that as much as possible.

This is a lot of stuff to implement, it might take longer for that :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks for considering these changes Garvin - they would really expand the utility of the contact form, especially when using the same plugin for different purposes within a single blog.

The points I mentioned that you said were difficult are more "nice to have", so no big deal if you cannot implement those, or do think they are worthwhile for some other reason.

Regarding #7: Below is a screen shot of what I meant. This is a simple contact form. It is using the dynamic tpl. I simply clicked "submit" without supplying a captcha (same thing happens with the wrong captcha) and received the error. I think it is confusing to see the FIRST error message ("Name, E-mail and your message must not be an empty string") that a)has nothing to do with the captcha, b)relates to the plugin_contactform.tpl - NOT the plugin_dynamicform.tpl, especially when a dynamic form might not contain the hard coded fields Name, Email and Message (although they do in my example), and c) these fields are not, in fact, blank.

Image

I noticed a change to the latest version of the contact form - previously, there were only 2 choices, made by selecting a radio button to use the dynamic form. In that version, when NOT using the dynamic form, this error message did NOT get displayed when the fields were complete, but the supplied Captcha was wrong. In the latest version, this error message is displayed for all the forms (standard, small business, detailed, custom) when only the captcha is wrong.

One final observation - when using the "standard" form, the field names do not show asterisks indicating the fields are required. The plugin_contactform.tpl does not contain {if $field.required}<sup>*</sup></p>{/if} like the dynamic form does. Not sure if that was deliberate, or an oversignt, but thought I would mention the observation.
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

"You did not specify the name field". This is an error message I am getting on the contact form. I presume this is generated by the Captcha plugin.

I do not want a field that simply says "name". Is there a way around this? I noticed one of the default forms uses "first name" and "last name" I do not want those either, but clearly there must be some way around the requirement for a field called something other than just "name".

Can I have a hidden field called "name", then set the value of one of my other fields to this hidden "name" field?
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Any thoughts on 1) my observation 2 messages above regarding the error message, and 2) my question regarding the contact form field "name" immediately prior to this message? TIA.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I'm sadly currently swamped with work, and I won't get to the contact form changes anytime soon (because I also don't know much about recent changes to that plugin and had to dive into that first).

So please be patient, it might take longer. But it's on my radar.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

I'm in the same boat as Garvin and I'm not even sure when I will have a chance to play with s9y again.

I'd also say that your number two issue is easily solved by using a dynamic template to recreate the basic form with a different "Name" field.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Busy year for s9y developers. I'm too busy, too: cars, computers, work and family.

Come on, newbie developers, time to make your mark!
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

I was able to modify the dynamic tpl to accomplish 2 of my wishes.

First, I moved the error messages to the top - this can be important if the preface text is lengthy - otherwise, a user might see the page refresh, but not immediately see the error message unless they scroll down.

Second - I supressed the preface message once the form is actually submitted without error with the following:

Code: Select all

<!-- do not show preface text if form has already been submitted -->
{if (empty($is_contactform_sent))}
<div>
	{$plugin_contactform_preface}
</div>
<br /><br />
{/if}
I do not know squat about PHP, but Google and code from various plugins helped me come up with that - code that is probably elementary to you experts, but is all new to me!
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Nicely done! If you need any advice on how to accomplish something more complicated, just let us know. (As long as we're browsing the forums, advice is free...)
Judebert
---
Website | Wishlist | PayPal
Post Reply