Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Disable 'start your dicussion' button until appropriate category select.

VazVaz New
edited October 2007 in Vanilla 1.0 Help
Hi guys, I had a really big problem before where members would type in a message and click start discussion but forget to put it in the correct category. Then I made a little change by adding ==please select category== as the top option for the drop down. It changed things around but sometimes people still forget to change that and end up hitting start your discussion which leads to a 404 page. When they click back in order to select the correct category there initial typing vanishes. Perhaps this could be solved by have some sort of a disabled 'start your discussion' button until a category other than == please select bla bla bla == is set?

Comments

  • Options
    edited October 2007
    easily done via javascript call a function at page load and select box change, if no category is selected, the disable the class "StartDiscussionButton" i can give you the jquery version of the code, if you want
  • Options
    Yeah sure image
  • Options
    It is a bug in the first place I thing. The user should get an error message if he doesn't submit a valid category.
  • Options
    Is their an extension that allows them to do this ==please select category== this functionality should be in that extension
  • Options
    My forum will not let a comment through without a category being selected.

    It comes up with "You must select a category for this discussion."

    I can't remember what I did but I do remember it was a very simple fix.

    Sorry can't tell you more right now until I get off this PC and home to my Mac.
  • Options
    edited October 2007
    Extension Removed
    Wanderer's one line code does the job.
    I guess this should be added to the vanilla core.
  • Options
    This is much easier...

    Locate this file...
    Library/Vanilla/Vanilla.Control.DiscussionForm.php

    insert after line 220 (inside GetDiscussionForm, just before the while loop):

    $cs->AddOption(0, 'Please select a category:');

    Posted: Monday, 8 October 2007 at 7:53PM

  • Options
    edited October 2007
    EDIT: this post refers to schizo's now edited post above

    Great! It almost works but is subverted if you use the previewpost add-on, as this button is not hidden.
    Trying to post via the 'submit comment' button in the preview pane results in an error.

    Personally, I think there's a UI-flaw with dimming the button - I see users complaining that "the button doesn't work" and giving up. IMHO a better and less confusing way would be to follow the existing scheme for error feedback. I'd rather the discussion button was visible, but that the error notice appears with "please choose a category", when no category is selected. Of course the user's text should not be lost and it should also appear if clicking 'submit comment' in the previewpost add-on. It's a quick reminder which doesn't stump newbie-users.
  • Options
    edited October 2007
    Wanderer, our posts crossed. Just tried your version but it doesn't seem to catch the situation when no category is selected. If I don't choose a category, I receive an "The requested URL ... was not found on this server." error.
    You can click "back" but the start discussion button is no longer clickable - it says "wait".
  • Options
    Well it works for me with PreviewPost but I am still on Vanilla 1.1.2.

    Posted: Monday, 8 October 2007 at 9:33PM

  • Options
    what does "it works for me" mean - what does it do exactly?
  • Options
    edited October 2007
    it gives you the error when no category is selected. it works as expected
    So the key was to use 0 or '' as the value. If you do that then it spits out an error message
    Some problems were encountered
    You must select a category for this discussion
  • Options
    This doesn't happen for me ... but I've found out why.

    I chanced upon this thread on the Attachments add-on and that seems to be the problem. If I disable the attachments add-on I receive the correct error message.

    You wouldn't happen to care to look at why the proposed fix for attachments isn't working? That would be wonderful...
  • Options
    Yep, it's the attachments extention which is leading the 404.
  • Options
    /bump

    Has some one got this working with the attachments extension? I'm getting the problem where members keep starting discussions in the top category =/
This discussion has been closed.