web2py i cant submit customized form with input

48 views
Skip to first unread message

Maurice Waka

unread,
Apr 30, 2017, 8:40:03 AM4/30/17
to web2py-users

I have a problem using input with web2py when it comes to form submission. My code below:

db.define_table('searches',
                Field('body', 'text', requires= (IS_NOT_EMPTY(), IS_LOWER()),
                      label= ''),
                auth.signature)


def view_searches():
    user_id = request.args(0, cast=int)
    id = request.args(0, cast=int)
    body = db.searches.body
    form = SQLFORM(db.searches, formstyle='divs')
    if form.process().accepted:
        pass


<div class="bottom_wrapper clearfix">
        {{=form.custom.begin}}
        <div class="message_input_wrapper">
            <input class="message_input" name="body" placeholder="Type your message here..." />
        </div>
        <div class="send_message">
            <div class="icon"></div>
            <div class="text">Send it</div>
        </div>
        {{=form.custom.end}}
</div>

I had the same issue with textarea and rectified with this but it looks like i might be missing something. My database is still empty when posting text. Please assist. Kind regards

Marlysson Silva

unread,
Apr 30, 2017, 12:45:53 PM4/30/17
to web2py-users
Try out form.custom.submit as button's form..

Anthony

unread,
Apr 30, 2017, 1:05:57 PM4/30/17
to web2py-users
How is the form submitted? It looks like you simply have some text in a div for the "Send it" functionality.

Anthony

Maurice Waka

unread,
Apr 30, 2017, 1:26:01 PM4/30/17
to web...@googlegroups.com
Yes

--
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/WESUOITgwbM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Apr 30, 2017, 3:49:04 PM4/30/17
to web2py-users
Yes to what? How is the form submitted?

Maurice Waka

unread,
May 1, 2017, 1:27:10 AM5/1/17
to web...@googlegroups.com
A user types in text. The send button submits it. That's where I find it difficult to submit the form 

On Apr 30, 2017 22:49, "Anthony" <abas...@gmail.com> wrote:
Yes to what? How is the form submitted?

Maurice Waka

unread,
May 1, 2017, 1:27:59 AM5/1/17
to web...@googlegroups.com
Done custom submit but there is no improvement 

On Apr 30, 2017 19:45, "Marlysson Silva" <marly...@gmail.com> wrote:
Try out form.custom.submit as button's form..

Anthony

unread,
May 2, 2017, 12:46:22 PM5/2/17
to web2py-users
Hard to say what's going on based on what you have shown. You'll have to do some debugging. When you submit, check the browser developer tools to see exactly what gets sent to the server and what comes back. On the server, inspect the incoming request and see what is missing.

Anthony
Reply all
Reply to author
Forward
0 new messages