Try reduce the scope of the JS

form = SQLFORM(db.inquiry, submit_button = 'Explore', 
_class="myform").process()

and use

var button = jQuery('.myform input[type=submit]');

On Sunday, 24 February 2019 16:53:08 UTC-8, Vlad wrote:
>
> I have the following line in the controller:
>
>     form = SQLFORM(db.inquiry, submit_button = 'Explore').process()
>
> the view has the following: 
>
>        {{=form}}
>        <script>
>            $('input:submit[value=Explore]').attr('style', "'width:400px; 
> max-width:100%;'");
>            $('input:submit[value=Explore]').attr('role', "'button'");
>            $('input:submit[value=Explore]').append("<i class='fa 
> fa-sign-in fa-md pr-2' aria-hidden='true'></i>");
>            $('input:submit[value=Explore]').addClass('btn btn-light btn-lg 
> btn-block');
>        </script>
>
> so it works partially: the classes (the last line in the scrip) are added, 
> so it displays a proper button. But everything else is not picked up - 
>
> Any ideas on what's wrong / missing? 
>
>

-- 
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.

Reply via email to