• I have created a custom Gutenberg form block with help from online searches and Ai. My form is to collect manuscripts from authors and store them as attachments to a custom post type.

    The form displays fine in the editor and on the UI but there is a problem with a drop-down list. On the front-end the value is not retained when it is selected. It appears to function correctly in the editor when a value is selected. On the UI, logging the action in the console shows the value selected.

    There seems to be a theme effect as well because the Go GoDaddy theme in the repository does not show the default select option which correctly displays in Twenty Twentyfour

    I would appreciate all help trying to fix my problem.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @starapple

    For your dropdown issue, try the following:

    [1]. Ensure the value attribute of the <select> element is updated based on state in the frontend render function. Add an onChange handler to update the selected value.
    [2]. Add conditional styling or JavaScript that sets the default option if it’s missing in your current theme.
    [3]. Consider using wp.data to manage state in the block or use a plugin like “Advanced Custom Fields (ACF)” for better form controls if the issue persists.

    Thread Starter starapple

    (@starapple)

    Hi @dilip2615, thanks for your suggestions. I’ll give them a try in a moment and report.

    Thread Starter starapple

    (@starapple)

    Hello @dilip2615, I spent the day going around in circles and ended up with the same result. You can look at the JavaScript in the console and see if I was on the right track.

    Thread Starter starapple

    (@starapple)

    Adding replacement link to reach the page I need help with as it has restricted access. New link. You will be redirected to the page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.