Try this:

search_form = SQLFORM.factory(Field('Search', requires=IS_ALPHANUMERIC()))
parent=search_form.element('input[type=submit]').parent
parent.components 
=[TAG.INPUT(TAG.I(_class='icon-search'),'submit',_class='btn',_type='submit')]

The problem is... the web2py code does what it is supposed to do (generate 
the corresponding html) but this is not the html that you want (as I 
incorrectly assumed). Look at the generated html and you should be able to 
tweak it to generate what you need.

On Tuesday, 31 July 2012 12:13:37 UTC-5, Alec Taylor wrote:
>
> Thanks, but that didn't work (can't tab to it + clicking it does nothing).
>
> On Wed, Aug 1, 2012 at 3:02 AM, Annet <[email protected]> wrote:
>
>>
>> How do I append the search button to the field, like on the 
>> twitter-bootstrap 
>>> site <http://twitter.github.com/bootstrap/base-css.html#forms>?
>>>
>>
>>
>> Given your example, closer to twitter would be something like:
>>
>>
>> search_form = SQLFORM.factory(Field('Search', requires=IS_ALPHANUMERIC()))
>> parent=search_form.element('input[type=submit]').parent
>> parent.components 
>> =[TAG.A(TAG.I(_class='icon-search'),'submit',_class='btn',href='#')]
>>
>>
>> Annet
>>  
>>
>> -- 
>>  
>>  
>>  
>>
>
>

-- 



Reply via email to