Jan 22nd, 2013, 8:03 AM
In Detail:
I am having trouble re-populating my friends in a one page form after the user incorrectly enters the Captcha. It is located http://certus.worldpath.net/contactRePop.php#Email. Right now, I have a warning that the fields will not save their information and to type their message outside of the form, but I don’t think that is particularly user-friendly. This is not currently a “live” site, but I would like to solve this issue before it becomes so.
I’ve built a few forms using CAPTCHAs by following the tutorial “Adding CAPTCHAs to your POST form”. They work, but I have not successfully implemented “step 3. Re-entering fields”. For some reason, the php code located within the quotes for the “value”, print as the text on the form. (I’ve seen forms on other websites do this, clearly experiencing the same thing as I am, but don’t know how to fix it)
I have a couple of theories, but due to my lack of experience with php, am unsure if they are realistic.
1. My form fields are within div tags. The example uses br tags to move things along, but I wanted greater control over the “look” of my form. I imagine this could cause an issue.
2. I am using “id” and “class” instead of “name” to define my divs. I’ve not really encountered “name” before and will be looking into it further while I await the brilliance that exists on this forum to comment on my post. I did try to drop the formatting of the form and use “name” but it didn’t seem to help.
3. Short tags vs long? I did try switching between both, but with no impact.
4. Perhaps my server side form validation is messing with things?
I spent Friday combing through the forums trying to find someone describe a similar issue, but did not find it. Perhaps I don’t know the correct terms to search, and would welcome being pointed to that post. Some of them seemed similar, but not quite applicable. For instance, “Re-filling form fields using the API”, seems applicable, but I am using the “POST” form and so “step 3. Reentering fields” should work, but it is not. My form is only a page long, and so going the more complicated method using “Adding a single page form with the API” seemed like overkill.
I’d rather not re-build the form, but if someone on these forums can’t help me, that will be my next step.
Unfortunately, a second issue makes investigating this problem a little annoying. When the CAPTCHA is entered incorrectly, and the form submitted, the page currently redirects to contactRePop.php and not contactRePop.php#Email, so the user (and you wonderful people helping me) may not be aware the form was entered incorrectly unless they click on the “Email Us” tab, again. I presume that somewhere within the code, I need to direct a failed CAPTCHA to the hash tag instead of the main address, but I have been unable to find where I do that.
Since the form is functional and does send me e-mails, if you decide to test it please put somewhere in the message that you are helping me with my issues. If you can tell me what fields, if any, should be censored, I would be grateful. If you include a real email address, I will forward the message as soon as I get it, in case it aids in your diagnosis.
I can post the messages received from the forms, if you would like, but don’t know if there is any information in the Test tab version that should not be public. If someone can tell me what fields, if any, should be censored, I will post one of my tests. Since the problem is only with failed submissions, I doubt this will help, however.
In Summary:
1. http://certus.worldpath.net/contactRePop.php#Email is printing the php script in “step 3. Re-entering fields” in my form fields and not re-populating when a CAPTCHA is incorrectly entered and submitted.
2. I can’t find where to change where the user goes upon an incorrect submission. Currently it sends to the “general” page of contactRePop.php as opposed to contactRePop.php#Email.
3. Is it “safe” for me to post the information from the Test versions of these emails for everyone to see or is there some information I should censor?
I’ve successfully solved my other bumps and problems through already posted questions and answers. This forum has been fabulous. I hope you all will be able to assist me, as well. I apologize for the length. I hope I’ve given enough information.