Anchor tag taken from the URL on the submit form

Freeform Version: 4.07 ExpressionEngine v2.5.3 - Build Date: 20120911

I have a free form form inside a jQuery tab. When a form is submitted using erros, the binding for this tab is removed from the URL. This brings me back to the first tab, not to the tab with the form. Is there a way to redirect the user back to the form tab?

thanks

<li id="qaTab"> {exp:freeform:form form_id="2" required="name|email|user_message" return="contact_us/thank_you" recipients="yes" recipient1="Happy Harry| h_harry@somemail.com " recipient2="Lazy Larry| lazyl63@somemail.com " recipient_template="contact_form" notify_user="yes" user_email_field="user_email" inline_errors="yes" } {if freeform:general_errors} <h2>There were some error(s) with your submission:</h2> <ul> {freeform:general_errors} <li>{freeform:error_message}</li> {/freeform:general_errors} </ul> {/if} <div class="row"> <div class="six columns"> <label>{freeform:label:name}</label> {freeform:field:name} {if freeform:error:name}<small class="error">{freeform:error:name}</small>{/if} </div> <div class="six columns"> <label>{freeform:label:email}</label> {freeform:field:email} {if freeform:error:email}<small class="error">{freeform:error:email}</small>{/if} </div> </div> {freeform:label:user_message} {freeform:field:user_message} {if freeform:error:user_message} <small class="error">{freeform:error:user_message}</small>{/if} <input type="hidden" name="subject" value="{title}" id="subject"> <input type="submit" name="submit" value="Submit" id="submit" class="button"> {/exp:freeform:form} </li> 
+6
source share
1 answer

You have to solve this with jQuery:

  • Checking for class errors
  • If exists: open a tab using the form
  • Else: do nothing

What was that:

 if ($(".error").length > 0) { $("#tabs").tabs("select", "#qaTab"); } 

Good luck

+5
source

All Articles