This is a possible javascript/jQuery solution. Seems to work well. Include this in your header.
<?php wp_head(); ?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('input[name="email2"]').parentsUntil('tbody').hide();
jQuery('input[name="email1"]').change(function () {
jQuery('input[name="email2"]').parentsUntil('tbody').show();
})
})
</script>
</head>
Thread Starter
rwilki
(@rwilki)
wow this would be so cool! thanks. do I also need to reference an external jquery file?
thanks,
Bob
As long as you include the code AFTER <?php wp_head(); ?>, jQuery should be already loaded.
Thread Starter
rwilki
(@rwilki)
oh I got you. it’s for the header file. at first I thought it went into the signup template file. Thanks so much! I’ll try it out and report back. Really appreciate it!
Thanks,
Bob
Hmmmm… I don’t actually know. I’m just used to putting these kinds of scripts in the header.
But I think you can put it anywhere you want, as long as it’s after <?php wp_head(); ?> because jQuery needs to be loaded.
Maybe if you put the code at the very bottom of the signup template, you won’t even need to use
jQuery(document).ready(function(){