We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Freeform: Captchas not refreshing after field error

Development and Programming

atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

Hello.

I am using freeform to create a survey. I have a file upload field and captchas to avoid spam. I am still working on a Test server.

My problem is that the form is not refreshing the captchas images after clicking the “return to previous page” from the error page.

If an user try to upload a file that is not supported, and all the fileds, including captcha is filled properly, the user gets the error page saying that the filetype is not supported. Now, if the user clicks on the “return to previous page” link, the captcha image doesn’t refresh and the field for the captcha keeps the same value as well.

Interesting enough, the field for the file upload gets cleared. Now if the user tries to upload a supported file, he/she will get an error saying that the word entered doesn’t match with the one displayed in the image.

Any idea why is this happening? I have been looking for similar cases, but I haven’t found a solution yet. I found this post in solspace forums: http://www.solspace.com/forums/viewthread/108/ But it is not solved.

My form is here: http://131.94.117.219/sunguide/index.php?/contact/general

Any help will be greatly appreciate it.

Thanks. Atiosis

Moved to Modules: Discussion and Questions

       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

Greetings!

Couple of questions.

a.) What version and build of ExpressionEngine are you running?
b.) What extensions are you running?

-greg

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

Hello Greg. Thanks for your reply. I am running ExpressionEngine 1.6.7 Build: 20090122; and only using the Freeform module.

Atiosis

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
16 years ago
John Henry Donovan's avatar John Henry Donovan

atiosis,

something odd is happening on your template. /contact/general is being rendered above the header of the page.

In your form code this is displaying

<form id='freeform' method="post" action="http://131.94.117.219/sunguide/index.php?"  enctype="multipart/form-data" >

I believe it should look like this

<form id='freeform' method="post" action="http://131.94.117.219/sunguide/index.php?/contact/general"  enctype="multipart/form-data" >

I would try creating a separate testing template and reduce your form and tags to a bare minimum unitl you find the culprit, but I think there may be a syntax problem there.

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis
<form id='freeform' method="post" action="http://131.94.117.219/sunguide/index.php?"  enctype="multipart/form-data" >

Do you think this is what is not allowing the captchas to refresh? I have no idea on how to fix that. :(

I did try simplifying the template and testing, and still getting the same results.

       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

As John said, if you view the source of the page, you see:

/contact/general

<!-- CONTACT - GENERAL -->

And as a general rule, we shouldn’t have anything above the DocType. Can you try to isolate where that is coming from?

Also, as a quick test, please make a totally bare-blank template and paste only the freeform form tag in it. Test it to see if we receive the same problems and hit us with a link to that page.

-greg

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

Hello. Thanks a lot for looking into this. I created a new template, here is the link: http://131.94.117.219/sunguide/index.php?/contact/test/

The path that appears on the top is out of my control. The person that set up the server and the engine added for I don’t know what purpose. I just requested him to remove it, but that will be tomorrow.

The code used for the template is as follows:



Again thanks a lot. I hope you guys can help me get this going!

Atiosis

       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

Sorry, I meant bare blank template with only the freeform code, eg:



No styles, etc. just that code.

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

Hello. here is the new form, just the freeform code: http://131.94.117.219/sunguide/index.php?/contact/test/ Below is the form’s code.

{exp:freeform:form form_name="Contact Home" return="contact/thanks" notify="[email protected]" template="contact_home" required="name" file_upload ="Contact" send_attachment="yes"}


<table cellpadding="0" cellspacing="0">
        
            <tr>
               
                <td><span class="red">*</span>Name:</td><td class="form_row_field"><input type="text" name="name" value="" /></td>
                
            </tr>
           
          
          <!-- begin test upload file -->
          <tr>
           <td colspan="2">
                <input type="file" name="file1" /><br>
                (<span class="red">The size of file upload should not exceed 20 MB.</span>)
                <h4><strong>Supported file formats:</strong>
.pdf, .swf, .bmp, .gif, .jpeg, .jpg, .jpe, .png, .txt, .html, .doc, .docx, .xl, .xls, .mov, .mpg, .mpeg, .mp3</h4>
            </td>
        </tr>
         <!-- end test updload file -->
           
                {if captcha}
                
                <tr>
                <td valign="top">Enter this value:</td><td>{captcha}</td>
                </tr>
                
                
                
                <tr>
                <td valign="top">*Here:</td><td><input class="captcha" type="text" name="captcha" value=""/></td>
                </tr>
                {/if}
                 
                <tr>
                <td valign="top"> </td><td><h4>*Indicates Required Fields</h4></td>
                </tr>
                
                <tr>
                <td valign="top"> </td>
                
                <td>
                
                <input type="submit" name="submit" value="Submit" />
                <input type="reset" name="reset" value="Reset"/>
                
                </td>
                </tr>
            
            
        </table>

 
{/exp:freeform:form}

Again.. THANKS A LOT!

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

I just uploaded a file using that last bit of code, it appeared to work. ???

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

Hi Sue, try uploading an unsupported format. When you get the error, click the return to previous page link and try re-submitting a supported file format, that’s when you get the error. If I submit a supported file format, the form works just fine, the problems shows when I get an error and have to come back.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

So when going back to the previous page, the captcha value isn’t set to something else.

hmmmmm… have you contacted the Solspace guys about this?

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

I posted on their forums (http://www.solspace.com/forums/viewthread/2542/) - interesting enough I never got an email that someone replied, but it was not a solution. :(

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

There might not be a solution other than don’t do that. If they refresh the page, the captcha will refresh, and you’ll have a new one..

In any case, this isn’t an EE issue per se. I’m going to move this to the Modules forum in the mean time.

       
atiosis's avatar
atiosis
180 posts
16 years ago
atiosis's avatar atiosis

Hello again. The problem was with Freeform. Kelsey took care of it and released an updated version. Thanks a lot to all for your help. Here is a link of my thread with Solspace support: http://www.solspace.com/forums/viewthread/2542/

Atiosis

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.