Contact Form questions

Creating and modifying plugins.
Post Reply
Harald Weingaertner
Regular
Posts: 474
Joined: Mon Mar 27, 2006 12:32 am

Contact Form questions

Post by Harald Weingaertner »

Hello,

i use the contactform plugin and created a custom template. This works great, but is it possible to do something additional?

I would like to be able to check if a given e-mail address is correct and when i receive the email from the contactform i do see my ofn email address as sender, nit the email address of the user who filled the form.

So something like

require;Email;email

instead of

require;Email;text

would be great (to tell the script, that this field is reserved for a valid email).

Is this somehow possible?


Also, is it possible to adjust the message sent from the form? I don't like the "A new comment has been posted on your blog "Netcam Watcher Surveillance Software Blog", to the entry entitled "Contactform"." at the top.

Best regards, Harald
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Post by Davy »

You can require fields using the Spam plugin.

And for your last question: Edit your language-file. Search for this line:

Code: Select all

@define('A_NEW_COMMENT_BLAHBLAH', '...');
Harald Weingaertner
Regular
Posts: 474
Joined: Mon Mar 27, 2006 12:32 am

Post by Harald Weingaertner »

Davy wrote:You can require fields using the Spam plugin.
Sorry? I talk about this contact form: http://www.netcam-watcher.com/blog/page ... tform.html

I would like to be able to check for a valid e-mail address. I can define email als required in the spam protector, but this has nothing to do with the contact form plugin, right?
Davy wrote: And for your last question: Edit your language-file. Search for this line:

Code: Select all

@define('A_NEW_COMMENT_BLAHBLAH', '...');
Wouldn't this cause all Comments from the regular entries to have the new line at the top? I just want to "rename" the first line for the Comment Form Messages.
Last edited by Harald Weingaertner on Sat Jan 06, 2007 1:00 am, edited 1 time in total.
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Post by Davy »

You're right in both cases, so my answers turn useless for your situation.
Harald Weingaertner
Regular
Posts: 474
Joined: Mon Mar 27, 2006 12:32 am

Post by Harald Weingaertner »

No problem, thanks anyway. Anyone else?
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

I can help with the second query, how to change the text that appears in the email. Open serendipity_event_contactform.php in the plugin folder, and do a search for the string A_NEW_COMMENT_BLAHBLAH.

Once you've found it, change it to PLUGIN_CONTACTFORM_COMMENT_BLAHBLAH. Now save and close this file, then for each language file within the plugin folder that you use, add this

Code: Select all

@define('PLUGIN_CONTACTFORM_COMMENT_BLAHBLAH', 'A new comment has been posted on your blog "%s", to the entry entitled "%s".');
Then just change the text. The first and second %s refers to the "Netcam Watcher Surveillance Software Blog" and "Contactform"

Just remember that by making this change if you upgrade the plugin in the future you will have to do this again.
Harald Weingaertner
Regular
Posts: 474
Joined: Mon Mar 27, 2006 12:32 am

Post by Harald Weingaertner »

Thanks Carl.

Now i just need the "email feature" ;)
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Hi Harald,
This would be easiest to implement with a javascript added to the plugin_dynamicform.tpl file. You could copy the tpl into you template directory and fiddle with it there. I have a feeling there are quite a few javascript email validators online.
If this won't work (I understand the problems of client side validation), I might be able to put something together towards the end of this month or early next. I'm just really pressed for time right now, and have had some things come up that have really made it difficult to work on s9y right now.
Harald Weingaertner
Regular
Posts: 474
Joined: Mon Mar 27, 2006 12:32 am

Post by Harald Weingaertner »

Thank you Matt.

I'll play with the template and see what i can do. Maybe i can do it myself :)

Regards, Harald
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: Contact Form: Custom target, E-mail validator

Post by Huhu »

Good idea with the validators. I had the same question and will try that, for SPAMprotector doesn't work with dynamicform.tpl (the names of the fields don`t match the SpamBlock).
In custom.tpl, setting input type="text" to "input type="email" does the trick as well.

Which brings me to a couple of other questions:
1. By entering a second email adress field, would it be possible to check if both fields have the same value (id est, adress), to avoid typing errors?
EDIT I have done a solution with a php script here: http://board.s9y.org/viewtopic.php?f=4& ... #p10437961
2. How can I set a custom target page after someone has sent a message? Id est, instead of the custom "Thank You" (or whichever text has been written in the plug-in interface), redirect the user automatically to a custom static page and away from the contact form page.
A target (say, staticpage_thanks.shtml) specified as a formaction just ends up with a staticpage blended with an entrypage (id est, the conact form page again).
Is there a passibility that allows a redirection to a completely new page?

I have now done a workaround by including the welcome text into the tpl file, after <form>. That works as well.
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Post Reply