Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
890 views
in Plugins by

My Q2A site uses an advanced theme, which includes a PHP file as homepage template. I added This code as AskBox to it which works fine:

        <form action="./?qa=ask&cat=" method="POST">
                    <div class="custom-combo-box">
                        <select class="custom-select">
                        <option>1st cat</option>
                        <option>2nd cat</option>
                        </select>
                    </div>
                    <INPUT NAME="title" TYPE="text" CLASS="qa-form-tall-text custom-ask-text" value="" placeholder="Ask your question" autocomplete="off" role="textbox">
                    <INPUT CLASS="custom-ask-submit" TYPE="submit" value="ask">

            <INPUT TYPE="hidden" NAME="doask1" VALUE="1">
        </form>

the theme is actualy right to left, but you got the Idea.

"select element" should be be filled from database, and send Category value to "ask page". How to do it?

Q2A version: 1.5

1 Answer

+3 votes
by

For Q2A 1.5, you can set the category for the ask page by having a field with the name category_0. You can prepopulate its values from the database with a regular query - the field value should be the category ID.

...