I am loading new form fields from Ajax when I click on radio button in my custom widget. In Ajax callback handler, I need to use get_field_name and get_field_id widget class methods. get_field_name method is return in WP_Widget class. So I try to get the instant of that class. But I unable to do that. So please someone help me how to use it in external class.
function wp_ajax_suport(){
add_action('wp_ajax_my_func', 'my_func');
add_action('wp_ajax_nopriv_my_func', 'my_func');
}
add_action( 'init', 'wp_ajax_suport' );
function my_func(){
<input type="text" name="<?php $this->get_field_name('name'); ?>">
}
$this->get_field_name
function in ajax handler.