Title: error for remote validation
Last modified: April 25, 2019

---

# error for remote validation

 *  Resolved [hurab](https://wordpress.org/support/users/hurab/)
 * (@hurab)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/)
 * Hi i have followed every step of the encoding as you have suggested and have 
   changed few field
    add_action( ‘wp_ajax_nopriv_get_user_information’,’smartform_ext_get_user_information’);
   add_action( ‘wp_ajax_get_user_information’,’smartform_ext_get_user_information’);
 * function smartform_ext_get_user_information(){
    $current_user = wp_get_current_user();
   if($current_user==false) return “{}”;
 *  echo json_encode(array(
    “name”=>$current_user->user_firstname. ‘ ‘. $current_user-
   >user_lastname, “order id”=>$current_user->user_order_id, “products”=>$current_user-
   >user_products )); die();
 * }
    but when i enter the function Remote.Post(ajaxurl,{“action”: “get_user_information”}).
   name for name it gives me error remote is not defined please guide where i am
   doing wrong much thanks

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11467092)
 * could you send me a link to your form please?
 *  Thread Starter [hurab](https://wordpress.org/support/users/hurab/)
 * (@hurab)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11468762)
 * I use the below code which you provided but with some ammendments i changed the
   email with order number and products.
 * add_action( ‘wp_ajax_nopriv_get_user_information’,’smartform_ext_get_user_information’);
   
   add_action( ‘wp_ajax_get_user_information’,’smartform_ext_get_user_information’);
 * function smartform_ext_get_user_information(){
    $current_user = wp_get_current_user();
   if($current_user==false) return “{}”;
 *  echo json_encode(array(
    “name”=>$current_user->user_firstname. ‘ ‘. $current_user-
   >user_lastname, “ordernumber”=>$current_user->order_number, “productName”=>$current_user-
   >product_name )); die();
 * }
 * this is the link of the form [https://www.greencotton.my/post_type=smartforms_preview&p=11213&sfpreview=true](https://www.greencotton.my/post_type=smartforms_preview&p=11213&sfpreview=true)
 * 2. please guide why the two lines are appearing as the header on the form
 * Much Thanks
 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11469757)
 * Hello, i checked your link but i got ‘page not found’ do i have the right link?
   seems like you send me the preview url which is actually not public. You would
   need to add the form to a page/post and send me the link to it.
 * Regards!
 *  Thread Starter [hurab](https://wordpress.org/support/users/hurab/)
 * (@hurab)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11470208)
 * oops sorry
 * [https://www.greencotton.my/returrn/](https://www.greencotton.my/returrn/)
 * now i saw its only that name can be autofilled defaulted but the other cannot
   
   Please guide
 * Much Thanks
 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11473637)
 * Does that form has that remote thing? I checked the form but couldn’t find it.
 *  Thread Starter [hurab](https://wordpress.org/support/users/hurab/)
 * (@hurab)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11476444)
 * hi if you want so i can provide you the login so you can check
 *  Thread Starter [hurab](https://wordpress.org/support/users/hurab/)
 * (@hurab)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11476449)
 * actually what i have done is that on my clients account dashboard i have inserted
   the button return order and when they press the button the form should appear
   autofilling their product name and order number. they just have to write Reason
   of return
    i changed your code wording only add_action( ‘wp_ajax_nopriv_get_user_information’,’
   smartform_ext_get_user_information’); add_action( ‘wp_ajax_get_user_information’,’
   smartform_ext_get_user_information’);
 * function smartform_ext_get_user_information(){
    $current_user = wp_get_current_user();
   if($current_user==false) return “{}”;
 * echo json_encode(array(
    “name”=>$current_user->user_firstname. ‘ ‘. $current_user-
   >user_lastname, “ordernumber”=>$current_user->order_number, “productName”=>$current_user-
   >product_name )); die();
 * }
    is there something i am doing wrong please help me to get the autofilled order
   number
 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [7 years ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11501378)
 * Hello!
 * Sorry for the delay, just checked again and it seems to be working. In my case
   it doesn’t fill the fields because i am not logged in but the service returns
   the data properly:
 * {“name”:” “,”ordernumber”:false,”productName”:false}
 * The formula displays the data ‘name’ (which in this case is an empty string).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘error for remote validation’ is closed to new replies.

 * ![](https://ps.w.org/smart-forms/assets/icon-256x256.jpg?rev=1226707)
 * [Smart Forms - when you need more than just a contact form](https://wordpress.org/plugins/smart-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-forms/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/error-for-remote-validation/#post-11501378)
 * Status: resolved