0

I've created a custom field called "istituto" in the user profile section that works properly if it is updated within the profile itself.

I have created a custom registration form with a field called "istituto". The submit button of this form is a div with class ".form_acc_2" and the field "instituto" has an id #dhvc_form_control_istituto. I wrote in jquery a code that fetches the value when inserted:

var istituto = '';
jQuery('div.form_acc_2').click(function(){   
   var istituto = jQuery('input#dhvc_form_control_istituto').val();
   if(istituto.length != 0)
   alert(istituto);
   return istituto;   
   })

Now the value is in the variable "instituto". How can I update the custom field "istituto" inside the user profile using the update_user_meta function?

Did I use a wrong approach?

2
  • I don't understand which value do you want to save in the user meta ?
    – mmm
    Nov 30, 2017 at 12:09
  • the value inside input "istituto" ... here: <input data-field-name="istituto" autocomplete="off" type="text" id="dhvc_form_control_istituto" name="istituto" value="" class="dhvc-form-control dhvc-form-control-istituto dhvc-form-value " placeholder=""> Nov 30, 2017 at 12:42

1 Answer 1

0

ok everything fixed at the time, I modified the oroginal form with "register_form" and then I called the input with that value in my custom form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.