Reset recaptcha contact form 7 [closed]

Since the recaptcha is created by contact form 7 without assigning the rendered recaptcha to a variable it was not possible to use grecaptcha.reset(opt_widget_id). Here is what is did: $(“.wpcf7-submit”).click(function(event) { var currentForm=$(this).closest(“form”); $( document ).ajaxComplete(function(event,request, settings) { var responseObj=JSON.parse(request.responseText); if(responseObj.mailSent==true){ //reset recaptcha var recaptchaIFrame=currentForm.find(“iframe”).eq(0); var recaptchaIFrameSrc=recaptchaIFrame.attr(“src”); recaptchaIFrame.attr(“src”,recaptchaIFrameSrc); } }); }); I have cleared the … Read more

Form Processing

I’m not sure what the root cause of your issue is. But I do see a syntax error in your last code block, which could be what’s causing the white screen. Your “action” attribute is missing a close quote. Try this instead: <form action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>” id=”new_post” name=”new_post” class=”form-horizontal” method=”post” enctype=”multipart/form-data”>

How to Process Form Request

Rename your form fields so they don’t clash with WordPress query vars, specifically name. Reserved $_GET and $_POST terms in WordPress: attachment attachment_id author author_name calendar cat category category__and category__in category__not_in category_name comments_per_page comments_popup customize_messenger_channel customized cpage day debug error exact feed hour link_category m minute monthnum more name nav_menu nonce nopaging offset order orderby … Read more

404 on form submit [duplicate]

Do not use variable name “name” for html textbox control, use something else. This behavior is due to internal handling of WordPress with “name” variable found in query string of posted data.

How am I able to get the value out of cookie array when I push a button?

You need to put the id of each item inside form to indicate the item that will be deleted. <?php $all_favorites= unserialize($_COOKIE[‘favorites’]); echo ‘<table>’; foreach($all_favorites as $key => $value) { echo ‘<tr>’; echo ‘Post-ID = ‘ . $value . ‘ ‘; ?> <form method=”POST”> <input type=”hidden” name=”id” value=”<?php echo $value; ?>”> <button type=”submit” class=”btn btn-default” … Read more

Add contact form

If you are self-hosted, you won’t have that button, as that is for WordPress sites hosted by wordpress.COM See The difference between WordPress.com, WordPress, and WordPress.org Search for plugins for self-hosted WordPress: http://wordpress.org/extend/plugins/search.php?q=contact+form&sort= http://wordpress.org/extend/plugins/contact-form-7/ is very popular.

Performing a POST action on homepage goes to posts page

When posting a form, if you use ‘name’ as an input name then there seems to be a problem with submitting. Try changing: <input type=”text” name=”name” class=”form-contact__text” /> to: <input type=”text” name=”the_name” class=”form-contact__text” /> Also, best to give your submit button a more unique name in case it conflicts with any plugins/themes – then check … Read more

Using the WordPress selected() function

The selected function causes immediate output, it does not return a string. Therefore you can’t use it like that, in a string building mode. If you want it to return a string instead of immediately outputting the text, pass false to the $echo parameter. $string = ” <select name=”gender”> <option value=”male” ” . selected( $values[‘gender’] … Read more

Get data from dropdown and update page

How about this: <?php $arr = [“Cat”, “Dog”, “Cow” ]; if( $_POST[‘animal’]){ $animal=$_POST[‘animal’]; echo $animal; } ?> <form name=”f” id=”a” method=”post” action=””> <select id=”animal” name=”animal” onchange=”this.form.submit()” > <option value=”0″>–Select Animal–</option> <?php foreach ($arr as $a){ if($a == $animal){ echo “<option value=”{$a}” selected >$a</option>”; }else{ echo “<option value=”{$a}” >$a</option>”; } } ?> </select> </form> Note you … Read more