PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Set hidden field value to multiple choice field value

  1. Naomi
    Member

    Hello, I'm trying to set the value of a hidden field to the value of a multiple choice field - like so: {MCFieldName:1:value}

    since I can't pass the value of the multiple choice field directly to a user registration profile field. (Of course, I've set the values of the MC fields)

    However, that syntax doesn't seem to work, as the admin area shows the syntax I entered as the value of the hidden field, and not the actual value of the user-selected MC field.

    Can you point me in the right direction to get this to work properly?

    Thanks :)

    Posted 11 years ago on Sunday March 27, 2011 | Permalink
  2. To clarify, I take it you are using the User Registration Add-On and have a Multiple Choice field on your form and are trying to store the Value and not the Option Label of a Multiple Choice in user meta?

    Is the issue when you map the field to the multiple choice field the option label is being used and not the value?

    Just trying to understand the issue before we can determine what the next step is.

    Posted 11 years ago on Sunday March 27, 2011 | Permalink
  3. Naomi
    Member

    Hi Carl, yes I am trying to map the value of a MC field to a user meta field, using the User Registration Add-On.

    Since I was unable to do it directly, I tried sending the value to a hidden field first, using the following code: {MCFieldName:1:value}.

    But when I submit the form, I just get the code I used echoed back to me: {MCFieldName:1:value} That's what appears in the form entry.

    Posted 11 years ago on Sunday March 27, 2011 | Permalink
  4. Naomi
    Member

    So, Carl let me know that you can only use the variables in the dropdown to prepopulate a field (default field value) and need to use PHP and available hooks to accomplish what I want.

    Can you point me in the right direction for populating a hidden field with the value of a multiple choice field?

    Or, is there a way to map the value of a MC field to a user meta field in the User Registration Add-On?

    Thanks :-)

    Posted 11 years ago on Sunday March 27, 2011 | Permalink
  5. We are going to update the User Registration Add-On and release an update today or tomorrow that will resolve this. It should be using the Value if a Value exists rather than the Option name. So we are changing it to behave that way.

    Posted 11 years ago on Monday March 28, 2011 | Permalink
  6. On further inspection, the User Registration Add-On should already be using the VALUE of selection fields (drop down, radio button, checkboxes) when populating User Meta and BuddyPress fields. So it should already be using the VALUE if you have populated a VALUE, if there is no VALUE it uses the OPTION LABEL.

    Posted 11 years ago on Monday March 28, 2011 | Permalink
  7. Naomi
    Member

    Ok, so I'm not sure if I was going crazy and just seriously overlooked something or an update was made or I just needed to refresh the site - but I am now able to map my multiple choice field directly to a user meta field in the User Registration Add-On. So I no longer need to send the value to a hidden field.

    Thanks :-)

    Posted 11 years ago on Tuesday March 29, 2011 | Permalink

This topic has been resolved and has been closed to new replies.