I've changed from method='GET' to method ='POST', name=message ' (the table
name) etc. But I seem to have an issue with the highlighted part. It's
still not posting. Could you please give an example of how this can work?
<form action="" enctype="multipart/form-data" method="POST" class="hidden">
<select data-conv-question="Hello! I'm
a bot created from a HTML form. Can I show you some features? (this
question comes from a select)">
<option value="yes">Yes</option>
<option value="sure">Sure!</option>
</select>
<input type="text" name="message"
data-conv-question="Alright! First, type one word e.g. 'exercise', or ask a
question.|Okay! you can type one word e.g. 'Soy', or ask a question.">
<input type="text"
data-conv-question="{{=reports}}" data-no-answer="true">
<input
Regards
On Fri, 6 Jul 2018, 18:11 Anthony <[email protected]> wrote:
> Your HTML will submit form data to web2py via the URL query string (due to
> using the GET method), but your controller code is not set up to properly
> process the form data. Instead, it defines a SQLFORM that does not exactly
> match the HTML form.
>
> See
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms
> and
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML
> for creating custom HTML in conjunction with SQLFORM.
>
> Anthony
>
> On Friday, July 6, 2018 at 10:49:28 AM UTC-4, Maurice Waka wrote:
>>
>> Hi.
>> Am trying out this html to get user input into the database and retrieve
>> the same/some other data from the same database. At the section below, I
>> cant seem to submit the user input, what could be the problem and how do I
>> correct it.
>> <form action="" method="GET" class="hidden">
>> <select data-conv-question="Hello!
>> I'm a bot created from a HTML form. Can I show you some features? (this
>> question comes from a select)">
>> <option value="yes">Yes</option>
>> <option value="sure">Sure!
>> </option>
>> </select>
>> <input type="text" name="message"
>> data-conv-question="Alright! First, type one word or ask a
>> question.|Okay! you can type one word or ask a question.">
>> <input type="text" data-conv-question
>> ="{{=responses}}" data-no-answer="true">
>> <input type="text" data-conv-question
>> ="This plugin supports multi-select too. Let's see an example."
>> data-no-answer="true">
>> <select name="programmer"
>> data-callback="storeState" data-conv-question="So, are you a programmer?
>> (this question will fork the conversation based on your answer)">
>> <option value="yes">Yes</option>
>> <option value="no">No</option>
>> </select>
>>
>> <select data-conv-question="This is
>> it! If you like me, consider donating! If you need support, contact me.
>> When the form gets to the end, the plugin submits it normally, like you had
>> filled it." id="">
>> <option value="">Awesome!
>> </option>
>> </select>
>> </form>
>> the controller code is this:
>> def search():
>> form = SQLFORM(Post, formstyle='table3cols').process()
>> code..
>> responses = responses()
>> return dict(form=form, responses=responses)
>> Post = db.define_table('post',
>> Field('author', 'reference auth_user', default=
>> auth.user_id, writable=False, readable=False),
>> Field('message', 'text', requires=IS_NOT_EMPTY(),
>> default ='', notnull=False),
>> auth.signature
>> )
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/ohTduB-ui7U/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.