Support » Plugin: Buddy-bbPress Support Topic » Making a Custom Form

  • Hello @g3ronim0

    I think the only draw back to this plugin is the topic status switcher. It relies on jQuery and I’m looking to change it to make it a great plugin. 🙂 I’ve tried to create a custom form but I cannot get the status to change. This is the code I inserted in to a Topic Info template which is loaded after the reply form for single topics.

    <?php echo '<form method="post" action="' . esc_url(bbp_get_topic_permalink($topic_id) ) . '" name="_support_status">';
    echo '<select class="support-select-status" name="_support_status" data-topicsupport="' . $topic_id . '">';
    echo '<option value="1">Not Resolved</option>';
    echo '<option value="2">Resolved</option>';
    echo '<option value="3">Not a Support Question</option>';
    echo '</select>';
    echo '<button type="submit" name="_support_status">Change</button>';
    echo '</form>'; ?>

    This looks like it should be working. I directly set the name of the selector and form as the name found in the default form with the plugin. Any ideas on how to get this working?

    The main thing is the loader is not accessible with assistive screen reading technology and I need the topic status drop down to act as a form.

    Thank you.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author Jérôme Sadler

    (@g3ronim0)

    Hi @alexstine,

    Thanks for the report. I would be happy to improve the user experience. I am not an a11y expert. The main problem if i understand it, is that the dropdown is not included in <form> ? I look at it, if you can test the changes with a screen reader, it would be perfect. Let you know as soon as i make changes.

    Thx

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    Hum, think i better understand the problem… When status changed by the dropdown, nothing is sent to the screen reader, the same when the action is complete. Isn’t it ? If this is the case, i think wp.a11y.speak can do the job. I looking for a solution.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    Can you test the changes made on this branch with a screen reader. Thank you.

    Thread Starter alexstine

    (@alexstine)

    Hello @g3ronim0

    The changes you made certainly improved things by a lot and I appreciate the work. I would still like to convert it to a regular form that uses a submit button and here’s why. After you switch to “Resolved” or “Not Resolved” the page does not refresh which leaves the title the same at “[Support request] or [Resolved] and I feel this could be confusing to some users. If the form submits plus the page refreshes, it will show the new label at the top of the page.

    The other point is if some people don’t have JavaScript enabled in their browsers, it will be a problem for them. I honestly like running a lightweight website and each extra JavaScript file no matter how big slows it down. I really don’t want to have to use any extra JavaScript.

    I hope this makes sense.

    Thank you.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    Yes, this makes sense. I’ll see if i change completely the form, or if i do a no-js fallback. I put it in my roadmap, thanks.

    Thread Starter alexstine

    (@alexstine)

    Hello,

    Yep, just a plane simple form is needed. Stay away from JavaScript with screen readers. That is ultimately the best way to do it. In the future I’d like to see 2 settings.
    1. Form using js.
    2. Plane HTML form.

    If you can write up an example of the plane HTML form for me, that would be great. The drop down as it is right now I will not include on my live site. Anyway you can create a plane form? You don’t even have to hook it in to the admin links, I’ll do the custom placement, I just need the form that submits the values and works to change the topic status.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    I agree, it would be perfect to have the 2 solutions. For the html form is not that simple. Currently it is processed only by AJAX, so i need to add a fallback to work without AJAX.

    Thread Starter alexstine

    (@alexstine)

    Hello @g3ronim0

    I hope you can get it done fairly soon. This is the only plugin on the market that is being supported and I don’t want to deploy to my live site without an HTML form. I will probably do a half deployment and exclude the form until you are able to make it work with an HTML form.

    Thanks.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    I’m doing my best on my free time. FYI this isn’t a market but a community directory. Stay tuned.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    I think i have a no-js version, can you try this version. Go to Settings > forums > Buddy-bbPress Support Topic > AJAX Submissions to disable AJAX requests.

    Tell me if you see any issues or improvements. I have to fix another bug before updating the plugin on the repo, you can use this version in the meantime.

    😉

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    Now in AJAX version, the title prefix is updated after request.

    Thread Starter alexstine

    (@alexstine)

    Hello @g3ronim0,

    The ajax is updating as expected and now changing the title. I could however not find the new setting that you added. Looked all over WordPress admin but it is just no where to be found. No other plugins active but bbPress.

    Thanks.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    Hi @alexstine
    Sorry I forgot the permissions in bbpress admin screen, you can try it now.

    • This reply was modified 4 years, 5 months ago by .
    Thread Starter alexstine

    (@alexstine)

    Hello @g3ronim0,

    That is awesome, works just fine without any issues. 🙂 I give it a +1. I have just one more question. I have a topic status section of my website in a custom table I coded, can I change where the form appears or is there a function I can call to make the form display in my custom template?

    Thanks.

    Plugin Author Jérôme Sadler

    (@g3ronim0)

    Thanks Alex, you can try : bpbbpst_get_selecbox(), i didn’t test that.

    Best regards.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Making a Custom Form’ is closed to new replies.