Topic RSS
4:06 am
Upgraded to 5.4 because I realized that my front page was not sending emails — I list several posts on the front page, with an email form for each entry (because most entries are by different authors). 5.4 says it fixed this issue, but I am still getting errors and non-submitted forms.
Is there an easy fix to having multiple copies of the same form on the same page?
8:47 am
I should add that I am using the same form on the page: It is mailed to whomever wrote the post as an alternative to leaving a comment. It is erroring because the forms use the same "id"s, instead of naming them uniquely (such as appending with a number).
1:57 pm
March 6, 2005
Offlinetripp said:
I should add that I am using the same form on the page: It is mailed to whomever wrote the post as an alternative to leaving a comment. It is erroring because the forms use the same "id"s, instead of naming them uniquely (such as appending with a number).
You can use multiple different forms per page, but not the same form in multiple posts per page.
My recommendation is to only include the form (then it can be the same form) in the single or page view.
5:42 pm
That's what I have resorted to doing. Would it be possible in future versions to
use names instead of ids for the forms and write out a unique identifier as part of the name? Then you could have multiples of the same form on the same page.
Basically, I want an email form option on my blog along with the comment form. A little DHTML and you can can flip back and forth between the two. Each form emails to the post author (multi-author blog). The plugin works great for all of this, except for the front page, where there are multiple posts.
9:21 pm
March 6, 2005
OfflineID's for forms are required for several reasons, e.g. javascript references.
On top, some logic would need to be implemented to detect the same form being used more than once on a page and adding a "counter". Or alternatively enhance the PHP function call used to paint the form to include the "counter" and add some code to the main cforms function to create each form with a unique ID…not exactly a straight forward thing to do. But then again it's only software anything is possible :-)
Further, I'm not sure how performance will suffer when having lots of posts on your index page.
2:44 am
Oliver said:
ID’s for forms are required for several reasons, e.g. javascript references.
On top, some logic would need to be implemented to detect the same form being used more than once on a page and adding a "counter". Or alternatively enhance the PHP function call used to paint the form to include the "counter" and add some code to the main cforms function to create each form with a unique ID…not exactly a straight forward thing to do. But then again it’s only software anything is possible :-)
Further, I’m not sure how performance will suffer when having lots of posts on your index page.
I don't know anything about Ajax (other than I like it.) Couldn't you use Ajax to call the form on the index page, so you wouldn't have to load multiple forms. I guess if someone really knew what they where doing, they could also make one close when the other opens.
I use java to show/hide the tell-a-friend feature on singal posts and pages, but because it only hides the form it doesn't work on the index page (other than the first post). For that page I use the 2nd deployment option as described in the help pages.
Don't get me wrong this is a great (if the the greatest) plugin. If someone gives me a Ferrari I'm not going to complain it didn't come with a full tank of gas. 
7:11 am
I would have no idea how to program this but; if you added the post/page ID to the form ID#, so it would know the form/style but could differ the post ID.. could that work?
Something like this:
<!–cforms5<?php the_ID(); ?>–>
–>
–>
Dennis, unfortunately it's not that easy. Here is essentially, in a more detailed way, what needs to be done:
cforms would need to be adjusted to understand a dynamic & unique counter for a given form.
- insert_custom_cform($fields='',$no='')
would need to become
insert_custom_cform($fields='',$no='',$dynID='') - function cforms($args = '',$no = '') {…
would have to be
function cforms($args = '',$no = '',$dynID='') {… - the tag ID needs to be set to
id="cforms'.$no.'form'.$dynID.'"
Now in your index template, after the post content you will have to change your insert_custom_cform($fields='',$no='') PHP code to include this counter, e.g.
insert_custom_cform($fields,'',$dynID);
wich addresses your default form (hence the '') and passes on the variable $dynID, which in turn needs to be set to 0 before The LOOP and incremented after the cforms call ($dynID++;)
The above is just off the top of my head – there may the one or other thing missing…but a start (does not respect javascript/ajax)!
1:35 pm
Yes, you are much warmer than my "description."
I knew it looked foolish but it was the best way I could describe what I was talking about.
I followed your instructions and it gave me a "submit" button under each post but no form. When I click on it I get a success message under all the posts. So I guess it's missing a few things, but getting closer.
PS
The rest of the forms in my contact section work fine.
9:19 pm
March 6, 2005
OfflineSorry, missed to say (there is probably more…) that you of course need to fill in the $fields array first. See the examples in the HELP section, you essentially need to recreate all fields that you have configured via the admin UI.
Also, since javascript is not "adjusted, you may want to turn off Ajax for this form (via the admin UI).
**edit:
and you want to change this line:
$action = $_SERVER['REQUEST_URI'] . '#usermessage'. $no . $actiontarget;
to
$action = $_SERVER['REQUEST_URI'] . '#usermessage'. $no . $dynID . $actiontarget;
AND this line
$content .= $nl . $indent . $tab . '<p id="usermessage'.$no.'a" class="info ' . $usermessage_class . '" >' . $usermessage_text . '</p>' . $nl;
to
$content .= $nl . $indent . $tab . '<p id="usermessage'.$no. $dynID .'a" class="info ' . $usermessage_class . '" >' . $usermessage_text . '</p>' . $nl;
AND finally
$content .= $indent . $tab . '<p id="usermessage'.$no.'b" class="info ' . $usermessage_class . '" >' . $usermessage_text . '</p>' . $nl;
to
$content .= $indent . $tab . '<p id="usermessage'.$no.$dynID.'b" class="info ' . $usermessage_class . '" >' . $usermessage_text . '</p>' . $nl;
4:41 am
Forgot the $fields array the first time.
But it is still submiting all forms with the changes above.
PS
Will this work with Tell-a-Friend?
8:31 am
March 6, 2005
OfflineUnfortunately, with T-A-F the same limitation applies. Have you turned off Ajax?
Can you remind me of the URL so I can take a quick look?
4:21 am
Unfortunately the site is not complete yet, and it is in a subdirectory only assessable by the admin.
Ajax is off.
I think I may be doing something wrong with this part:
"
wich addresses your default form (hence the ”) and passes on the variable $dynID, which in turn needs to be set to 0 before The LOOP and incremented after the cforms call ($dynID++;);"
Is there something I need to do before the loop?
Thanks
Most Users Ever Online: 959
Currently Online:
69 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3552
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5159
Posts: 18392
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote











