-
AuthorPosts
-
May 16, 2013 at 4:40 pm #23379
Hi Team Kriesi,
Good to be back! I’m on with a new site and have chosen the Enfold theme (which is superb, hat tip to the team).
I’m adding a Mailchimp signup form to the sidebar and and I have two questions; hope you can help.
1. How can I alter this line with some Javascript to record the URL they were on when completing the form?
input type="hidden" name="SURL" value="http://demourl.com/this-should-pull-in-the-page-url"
2. This part of the code has a class=”button”, but no subscribe is show. On entering an email and clicking return it works, but I need to have a subscribe button.
div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"
Thanks in advance if you’re able to help,
Regards,
Paul
May 16, 2013 at 4:44 pm #119621This is the whole code if it helps…
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form action="URL xxx" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form"
class="validate" target="_blank" novalidate>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address </label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
<input type="hidden" name="SURL" value="http://note.com/this-should-pull-in-the-page-url">
<input type="hidden" name="SOURCE" value="Wordpress">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-
embedded-subscribe" class="button"></div>
</form>
</div>
<!--End mc_embed_signup-->May 16, 2013 at 7:01 pm #119622Found a solution to the button missing. Changed the Clear to Not Clear.
Re: capturing the page URL, still hunting for a solutions there.
May 17, 2013 at 5:05 am #119623Hi,
I’m not sure but capturing url and javascript thingy seems a bit complicated. Let me tag the rest of the support team.
Regards,
Ismael
May 17, 2013 at 6:42 pm #119624Hi,
The current URL is easily retrieved with php
input type="hidden" name="SURL" value="<?php echo get_permalink(); ?>"
if you want to use jquery, add an id to the hidden field. the code will overwrite the initial value of the hidden field with a full url
input id="hidden_input" type="hidden" name="SURL" value="http://demourl.com/this-should-pull-in-the-page-url"
and then you can use this to change it, just add it to footer or elsewhere
<script type='text/javascript'>
jQuery(document).ready(function($){
$('#hidden_input').attr('value',window.location.href.toString());
});
</script>Thanks,
Nick
-
AuthorPosts
- The topic ‘Button Class and Javascript for the current page’ is closed to new replies.