How about you do something simpler, all in one line:

search_form = 
FORM(LABEL('Search:'),INPUT(_name='Search',requires=IS_ALPHANUMERIC(),

                    TAG.BUTTON(TAG.I(_class='icon-search'), _class='btn 
input-append'))

 I do not think SQLFORM.factory is for you in this case.


On Tuesday, 31 July 2012 11:05:47 UTC-5, Alec Taylor wrote:
>
> Thanks, it's working now. Final question:
>
>     search_form = SQLFORM.factory(Field('Search', requires=IS_ALPHANUMERIC()))
>
>     button = search_form.element('input[type=submit]', 
> _class='appendedInputButton')
>     parent = search_form.element('input[type=submit]').parent
>     parent.components = [DIV(TAG.BUTTON(TAG.I(_class='icon-search'), 
> _class='btn'), _class='input-append')]
>     
>     #<div class="input-append">
>     #    <input class="span2" id="appendedInputButton" size="16" 
> type="text"><button class="btn" type="button">Go!</button>
>     #</div>
>
>
> 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>?
>
> On Wed, Aug 1, 2012 at 1:52 AM, Massimo Di Pierro <
> [email protected]> wrote:
>
>> I do. Sorry.
>>
>>
>> On Tuesday, 31 July 2012 10:32:14 UTC-5, Anthony wrote:
>>>
>>> parent.contents=[TAG.BUTTON(..**..)]
>>>>
>>>
>>> Do you mean parent.components?
>>>
>>> Anthony
>>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 



Reply via email to