I managed to go to the basics and got some progress:
def searches():
form = FORM(INPUT(_name='message'), INPUT(_type='submit'))
code = request.vars.message
return dict(code=code)
view:
<form enctype = "multipart/form-data" action = "{{= URL()}}" 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="{{=code}}" data-no-answer="true">
</form>
However, as a test, when retrieving data to controller, the request.vars
does not give me the immediate user posted data, instead the previous data
posted. For example, if the user posts 'abcd', with the previous post
having been '1234', I'll get '1234' returned and not 'abcd'.
Is there a way of cleaning up request.vars and getting the CURRENT posted
data?
Thanks for the help, God bless!
On Fri, Jul 6, 2018 at 8:56 PM Anthony <[email protected]> wrote:
> On Friday, July 6, 2018 at 12:49:23 PM UTC-4, Maurice Waka wrote:
>>
>> 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.">
>>
>
> What exactly is the problem with that line? What are you expecting and
> what do you observe?
>
> Note, if you're using SQLFORM, you'll need to include {{=form.custom.end}}
> to make sure the hidden formname and formkey fields are included. Please
> read the documentation.
>
> Anthony
>
> --
> 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.