-
AuthorPosts
-
December 18, 2014 at 3:47 pm #167275
Question,
I want to track which form location people are signing up to my mailing list from. Mailchimp allows you to add hidden fields to forms, but I prefer using the form code generated by the X-theme because it doesn’t redirect off the page (instead it gives and in page confirmation). Any advice on how I can get the Xtheme form to submit this hidden information.
The field would be this, with the value changing depending on the form…
<input type=”hidden” name=”SIGNUP” id=”SIGNUP” value=”home1″ />
My form looks something like this…
[content_band bg_color=”#fff” bg_pattern=”http://fortheride.org/wp-content/uploads/2014/12/green_cup.png” border=”all” class=”center-text mtn” style=”max-width:900px;min-width:300px;margin:0 auto;”] [container][gap size=”-20px”] [custom_headline style=”margin: 0;” class=”mtn” level=”h4″ looks_like=”h3″]Join us as we build this awesome community![/custom_headline][custom_headline style=”margin: 0;” class=”mtm mbm” level=”h5″ looks_like=”h6″]Sign up for weekly updates.[/custom_headline]</p>
<form id=”x-subscribe-form-6794″ class=”x-subscribe-form x-subscribe-form-6794 center-block mvn” style=”max-width: 450px; font-size: 18px;” method=”post” data-x-email-confirm=”Message” data-x-email-message=”Thank you! You are now subscribed. Don’t forget to check your email to confirm your subscription.”>
<p><input name=”x_subscribe_form[id]” type=”hidden” value=”6794″ /></p>
<div style=”display: inline-block;”>
<fieldset><input id=”x_subscribe_form_full_name” style=”max-width: 350px;” name=”x_subscribe_form[full-name]” type=”text” placeholder=”Name” /></fieldset>
</div>
<div style=”display: inline-block;”>
<fieldset><input id=”x_subscribe_form_email” style=”max-width: 350px;” name=”x_subscribe_form[email]” required=”” type=”email” placeholder=”Email” /></fieldset>
</div>
<fieldset><input class=”submit x-btn x-btn-real x-btn-rounded” style=”max-width: 250px;” name=”x_subscribe_form[submit]” type=”submit” value=”Sign Me Up” /></fieldset>
</form>
<p>[/container] [/content_band]My website is http://fortheride.org
Thanks
December 19, 2014 at 8:48 am #167658Hi there,
Follow the example JavaScript code below and place it into your Customizer, Custom > JavaScript section to achieve that.
You can use the page ID or Class name that has been applied to a page.
jQuery('.home #x-subscribe-form-6794').append('<input type="hidden" name="myfieldname" value="myvalue" />'); jQuery('.page-id-2 #x-subscribe-form-6794').append('<input type="hidden" name="myfieldname" value="myvalue" />');
Hope that helps.
December 19, 2014 at 12:05 pm #167761Thanks for the help. Unfortunately that didn’t work. I really don’t understand what’s going on. If you have any other suggestions or input, I’d appreciate it. Thanks again.
December 20, 2014 at 6:58 pm #168198Hi there,
It simply add the form field you requested to be part of the form.
What I’m not sure is how that simple field will able to detect user’s location.
http://mailchimp.com/features/geolocation/
Let us know.
September 25, 2015 at 4:00 am #495305Hi,
Is this solution supposed to work in case of using MailChimp X Extension? I tried it – the tag appears in the code (http://cl.ly/image/300e1z260t3X), but data from this field doesn’t transfer to MailChimp.
This is the name of my MailChimp field – http://cl.ly/image/0Z3H3H0r2W2E – what should the code to append be?
Using MailChimp embed code works – http://cl.ly/image/2r262N2J2m1S btw. But I’d like to use the extension, since it’s styling is nicer and faster.
September 25, 2015 at 4:36 am #500468Hi,
Try adding class=”x-subscribe-form” to your mailchimp embed code to inherit the styles of x mailchimp extension.
Hope that helps.
-
AuthorPosts