khatrijay18
Forum Replies Created
-
Thank you so much.
i was tried with updated code but still not working ,
and http://54.225.8.87/test_wp/wp-admin/admin-ajax.php?action=get_contact_form&form_id=1&_=xxxxxxx in this page i can see “0” only on entire page
also i have request you to connect on skype, if its possible.
here is code.
custom.jsjQuery('.basic-vote-button').on('click', function(e){ var ele = jQuery(this); setTimeout(function(){ var getMsg = ele.parents('.basic-yop-poll-container').find('.basic-message-text')[0].innerHTML; var getId = ele.parents('.basic-yop-poll-container').attr('data-id'); if(getMsg == 'Thank you for your vote'){ jQuery('.callPopUp .popupaoc-link').trigger('click'); // here i am triggering popup when got thank you msg jQuery.ajax({ url: ajax_script.ajax_url, //global variable provided by WP type: 'GET', cache: false, data: { 'action' : 'get_contact_form', 'form_id' : getId }, success: function(data){ jQuery('#paoc-modal-2 .paoc-popup-modal-cnt').html(data); // here i am append the code what i ajax replied. } }); } }, 1000); });function.php
add_action('wp_ajax_get_contact_form', 'get_contact_form'); function get_contact_form(){ if(isset($_GET['form_id'])): $yop_poll = new YOP_Poll_Pro_Public(); $yop_poll_params['id'] = $_GET['form_id']; $yop_poll_params['show_results'] = $_GET['form_id']; echo $yop_poll->generate_poll( $yop_poll_params ); endif; exit(); }please let me know if you need any other detail. Thank you
- This reply was modified 4 years, 12 months ago by khatrijay18.
Please open link and refresh once, it will show popup after submit poll answer.
Thanks for you time.
Hello @yourownprogrammer ,
Did you check the link? do you need anything else from my side? Please let me know.
Thank you.
Hello @yourownprogrammer ,
Sorry for delay, I was create demo link for you reference.
Here it is: http://54.225.8.87/test_wp/index.php/recourse/
Please check and let me know if you required anything else.
Hi @yourownprogrammer ,
I tried to pass static value on show_results but its doing same it return poll as question format instead of result format.
This is my script which trigger popup first and then call YOP_POLL and whatever it return it will replace in popup HTML.
jQuery('.callPopUp .popupaoc-link').trigger('click'); jQuery.ajax({ url: ajax_script.ajax_url, //global variable provided by WP type: 'GET', cache: false, data: { 'action' : 'get_contact_form', 'form_id' : getId }, success: function(data){ console.log(data); //jQuery('#content').append('hello Here : ', data); jQuery('#paoc-modal-2 .paoc-popup-modal-cnt').html(data); } });And Here is my AJAX call.
add_action(‘wp_ajax_get_contact_form’, ‘get_contact_form’);function get_contact_form(){
if(isset($_GET[‘form_id’])):
$yop_poll = new YOP_Poll_Pro_Public();
$yop_poll_params[‘id’] = $_GET[‘form_id’];
$yop_poll_params[‘show_results’] = $_GET[‘form_id’];
echo $yop_poll->generate_poll( $yop_poll_params );
endif;
exit();
}Thank you
@yourownprogrammer Yes of course i should, but the thing is i am loading it on popup when poll submitted. i can see the poll in popup but its asking question instead of result.
I have already added your code as mention above one of my example.
- This reply was modified 5 years ago by khatrijay18.
For more Clearance (i am not able to upload screenshot so i am trying my best as words)
I have load total 3 Polls which 2 polls are as questions and 1 poll is show only results (this things are working fine with mention below array)
Array ( [id] => 1 [results] => 0 [tracking_id] => [show_results] => )
Array ( [id] => 2 [results] => 0 [tracking_id] => [show_results] => )
Array ( [id] => 1 [results] => 0 [tracking_id] => [show_results] => 1)Whenever i am going to open poll on new popup in popup i am getting this array
Array ( [id] => 1 [show_results] => 1)
but Poll loaded with question not result only.I hope you got me what i want to explain.
Thanks
- This reply was modified 5 years ago by khatrijay18.
@yourownprogrammer Need one more minor help
Your code id working fine now but when i am trying to call with show_results its not working as expected.
Like when we passing show_results parameter at that time the poll should be return result only
Here is my code.
$yop_poll = new YOP_Poll_Pro_Public(); $yop_poll_params['id'] = $_GET['form_id']; $yop_poll_params['tracking_id'] = ''; $yop_poll_params['show_results'] = $_GET['form_id']; echo $yop_poll->generate_poll( $yop_poll_params );I was tried to find out some way but not able to get success. Please Help!
Thank you.
Thank you so much @yourownprogrammer,
Here I want to add one more point, $yop_poll = new YOP_Poll_Public(); or $yop_poll = new YOP_Poll_Pro_Public(); whatever function in you public.php.
`add_action(‘wp_ajax_get_contact_form’, ‘get_contact_form’);
function get_contact_form(){
if(isset($_GET[‘form_id’])):
echo do_shortcode(‘[contact-form-7 id=”152″ title=”Contact page”]’);
echo do_shortcode(‘[popup_anything id=”461″]’);
echo do_shortcode(‘[yop_poll id=”1″]’);
//echo do_shortcode(‘[yop_poll id=”‘.$_GET[‘form_id’].'”]’);
endif;
exit();
}Here is my code in this contact-form-7 and popup_anything work as expected but yop_poll not working its return ‘[yop_poll id=”1″]’