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

on Freeform submit...nothing happens

Development and Programming

james Brown's avatar
james Brown
492 posts
18 years ago
james Brown's avatar james Brown

I have a single contact form template that changes its form_name based on a segment variable.

{if seg_2=="barcode"}
  {exp:freeform:form form_name="barcode_quote_request" return="contact/thank-you" notify="[email protected]" required="firstname|lastname|company|type|email|phone|address|city|state|postalcode|country|product|message"}
  {if:elseif seg_2=="cad"}
  {exp:freeform:form form_name="cad_quote_request" return="contact/thank-you" notify="[email protected]" required="firstname|lastname|company|type|email|phone|address|city|state|postalcode|country|product|message"}
  {if:else}
  {exp:freeform:form form_name="contact_request" return="contact/thank-you" notify="[email protected]" required="firstname|lastname|company|type|email|phone|address|city|state|postalcode|country|product|message"}
  {/if}
  {embed="includes/inc-contact"}
{/exp:freeform:form}

So as you can see there are 3 types a barcode from, a cad form and a generic form. With links of www.domain.com/contact/barcode, www.domain.com/contact/cad and www.domain.com/contact respectively. The barcode and cad forms work fine. Its the form that doesn’t have a segment variable that has the problem. The form shows up as it should, but when you hit submit, nothing happens. No email gets sent out. No empty field checking. No sending off to the thank you page. Here is the code generated for the contact form (minus the actual form fields).

<form id='freeform' name='contact_request' method="post" action="http://www.domain.com/contact/form/"  >
<div>
<input type="hidden" name="ACT" value="20" />
<input type="hidden" name="URI" value="/contact/form/" />
<input type="hidden" name="XID" value="48316b6c7811c77b9a26e4e7e53a2b33a32e792a" />
<input type="hidden" name="return" value="contact/thank-you" />
<input type="hidden" name="redirect_on_duplicate" value="" />
<input type="hidden" name="RET" value="http://www.domain.com/contact/form/" />
<input type="hidden" name="form_name" value="contact_request" />
<input type="hidden" name="id" value="freeform" />
<input type="hidden" name="tagdata" value="" />
<input type="hidden" name="params_id" value="424" />
</div>
<input type="submit" value="Submit" class="submit" />
  </form>

Any idea why this isn’t submitting??? The other ones work perfectly. The only difference is that segment URL.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
18 years ago
Lisa Wess's avatar Lisa Wess

I’d recommend posting this at solspace.com - but unless Solspace has done something very unusual (and I think impossible though I’m not 100% sure on that) - you can’t break apart a tag like that using EE conditionals, you’d have to use PHP.

Try surrounding the entire form in the conditional - as a note, it’s {if segment_2}.

You could also ditch the conditionals:

form="{segment_2}_quote_request"

I’d probably go with that last option, less processing. =)

       
james Brown's avatar
james Brown
492 posts
18 years ago
james Brown's avatar james Brown

oh ok…how come it worked for the barcode and cad parts of the conditional? Wouldn’t it have broke everything? I’m just curious. I will do what you recommended.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
18 years ago
Lisa Wess's avatar Lisa Wess

Just parse order and what it sees and in what order. But you don’t want to rely on something unsupported like that as you’ll always get unpredictable results.

       
james Brown's avatar
james Brown
492 posts
18 years ago
james Brown's avatar james Brown

Very true.

       

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.