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?