Il 21/09/15 17:16, Anthony ha scritto:
> Instead, try changing this.form.submit() to
> jQuery(this.form).submit(). That will wrap the form in a jQuery object
> and call the jQuery "submit" method, which will trigger the trap_form
> handler, which will submit the form via Ajax.
Great!! It's works as
>
> INPUT(_type="text", _class="form-control", _name="tip",
> _onchange="this.form.submit();",
> _oninput="this.onchange();"),
>
The problem is that above, this.form is the native DOM form element (not a
jQuery object), so the this.form.submit() is calling the form
btw: inline javascript trumps any event attached NEVER inline
javascript snippets!
On Monday, September 21, 2015 at 4:15:48 PM UTC+2, Anthony wrote:
>
> Have your put that inside a web2py Ajax component? Can you show the full
> code of the parent controller and view?
>
> Anyway, as an altern
Have your put that inside a web2py Ajax component? Can you show the full
code of the parent controller and view?
Anyway, as an alternative, you might want to take the approach shown here:
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Auto-completion
Anthony
On Monday, September
Il 21/09/15 15:03, Manuele Pesenti ha scritto:
> def _index():
> form = FORM(
> DIV(
> INPUT(_type="text", _class="form-control", _name="tip",
> _onchange="this.form.submit();",
> _oninput="this.onchange();" # COMMENT OUT THIS LINE
> ),
>
Il 21/09/15 14:36, Niphlod ha scritto:
> uhm... if the component has been loaded with web2py's facilities, then
> a form.submit should be "intercepted"/"handled" by
>
> https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L266
You can try inserting this little code
6 matches
Mail list logo