Page 1 of 1

Contact Form questions

Posted: Fri Jan 05, 2007 5:21 pm
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

Posted: Fri Jan 05, 2007 8:04 pm
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', '...');

Posted: Fri Jan 05, 2007 9:08 pm
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.

Posted: Fri Jan 05, 2007 9:46 pm
by Davy
You're right in both cases, so my answers turn useless for your situation.

Posted: Sun Jan 07, 2007 3:14 pm
by Harald Weingaertner
No problem, thanks anyway. Anyone else?

Posted: Sun Jan 07, 2007 6:18 pm
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.

Posted: Wed Jan 10, 2007 10:25 pm
by Harald Weingaertner
Thanks Carl.

Now i just need the "email feature" ;)

Posted: Thu Jan 11, 2007 5:54 pm
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.

Posted: Fri Jan 12, 2007 9:36 pm
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

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

Posted: Thu Jan 09, 2014 2:36 pm
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.