How to not store an entry on a form

I am trying to put a password verification field on my registration page. I have followed the applicable posts on this site and have got it all figured out except the following. The form doesn’t store the password – that’s good. However, it does store the password verification field entry. Then when the user goes to edit their registration profile, it comes up with the password field blank (like I want it), but the password verify field has an entry in it. I want it to come up blank. Any suggestions? I was thinking that if the password verify field could just be used for testing that they entered their password correctly and was never actually saved to the database that this would solve the problem.

formidablepro.com/knowledgebase/insert-a-form/

Using the "Fields" option you should be able to hide the field. You could also try setting that field to admin only.

Thanks, but hiding the 'verify password' field isn't what I need here. The field needs to show up, but I don't want to: (1) Store the 'verify password' entry in my database, or (2) Have a pre-populated entry in this field when the user goes to edit their profile information.

The 'Change Password/Edit Profile' option on this website (formidablepro.com) works exactly like what I am looking for. Suggestions?

Here's a slightly modified example from the knowledge base (the red is added).

add_filter('frm_validate_field_entry', 'your_custom_validation', 20, 3);
 function your_custom_validation($errors, $field, $value){
   if ($field->id == 31){ //change 31 to the ID of the confirmation field here
    $first_value = $_POST['item_meta'][30]; //change 30 to the field ID of the first field
   
    if ($first_value != $value){
      $errors['field'. $field->id] = 'The email fields do not match.';
    }else{
      $_POST['item_meta'][$field->id] = '';
    }
 }
 return $errors;
 }

Perfect! Thanks Stephanie - you are wonderful.

Now, can I change the title of the field - for example: on the original form it says "Password" and in edit mode it would say "Change Password - Leave blank to keep unchanged." Also can you remove the red star that indicates that it is 'required' when in edit mode.

You'll need custom code for this one too. Here are some examples:
http://formidablepro.com/knowledgebase/frm_setup_new_fields_vars/

The only difference is you will only use the frm_setup_edit_fields_vars and not use the frm_setup_new_fields_vars hook.

For not requiring that field, here's an example from another post.

add_filter('frm_validate_field_entry', 'my_custom_validation', 10, 3);
function my_custom_validation($errors, $posted_field, $posted_value){
  if($posted_field->id == 25 and isset($errors['field'. $posted_field->id])){ //change 25 to the ID of the password field
    if($_POST['frm_action'] == 'update' or $_POST['action'] == 'update') //if updating
      unset($errors['field'. $posted_field->id]); //remove the error message
  }
  return $errors;
}

OK, I'm starting to feel stupid. I have been trying for hours to do this and no luck. I am using the frm_setup_edit_fields_vars to try to change the label for my password field from 'Password' to 'Change Password - leave blank to keep unchanged' when a user edits their profile form. Sorry to ask, but I need some help. I'm assuming that this is called the 'name' in my efforts so far.

Also, as I mentioned before, I require the user to fill in a password when they first fill out this form - so there is a red asterisk that shows. However, I am using the php code that you suggest to not require the password upon edit. The problem is that the red asterisk still shows up - which would lead the user to believe that it is required that they fill out the password field on edit. So in a nutshell - how do you turn off the red asterisk when the user is editing the field.

Sorry to be so slow to figure this out.

 

Here's an example of changing the name:

add_filter('frm_setup_edit_fields_vars', 'frm_set_checked', 20, 2);
function frm_set_checked($values, $field){
if($field->id == 137){ //change 137 to the ID of your password field
   $values['label'] = 'Change Password - leave blank to keep unchanged';
   $values['required'] = false;
}
return $values;
}

Thanks, but I'm still having trouble. That does remove the 'required' asterisk, but it did not change the label from 'Password' to 'Change Password - leave blank to keep unchanged'. My code that I am using is:

add_filter('frm_setup_edit_fields_vars', 'frm_set_checked', 20, 2);
function frm_set_checked($values, $field){
if($field->id == 175){ //change 175 to the ID of your password field
$values['label'] = 'Change Password - leave blank to keep unchanged';
$values['required'] = false;
}
return $values;
}

Suggestions? Also, how do you know that the label is called 'label' and that the asterisk is 'required' etc. Is there a link to a reference for the names to all the different aspects of a field? I was trying to use 'name' instead of 'label' before and would have never figured it out.

Oops, you were right. It's called name, not label.

print_r($values); //this will tell you all the names and parts of the field array
$values['name'] = 'Change Password - leave blank to keep unchanged';
$values['required'] = false;

Everything works great now - thank you so much. However, I struggled because I would put this code in my plugin, update the plugin and then try it out to see if it worked. I would find that it wasn't working and be frustrated. In the end I found that my changes to my plugin were correct, but that they didn't actually show up until I logged out and then logged back in. So a lot of frustration and dead ends for nothing.

Anyway, you have been great Stephanie - Thanks!

Topic closed.