form.custom('table')

119 views
Skip to first unread message

Annet

unread,
May 23, 2012, 1:21:53 AM5/23/12
to web...@googlegroups.com
I have the following custom form:

<div class="form-header">
{{=response.function}}
</div>

<div class="form-body">

{{=form.custom.begin}}
{{#<!-- Add header here -->}}
{{=form.element('table')}}
</div>

<div class="form-footer">

{{#<!-- Add footer here -->}}
{{=DIV(form.custom.end[1])}}

{{#<!-- Add submit/cancel buttons here - you may even not use the submit variable -->}}
{{=form.custom.end[0]}}
</div>


What I want is to display <tr id="submit_table__row"> in the form-footer.
Using the code above {{=form.element('table')}} puts the entire form including the buttons in the form-body and renders this {{=DIV(form.custom.end[1])}} into an an empty <div></div> and this {{=form.custom.end[0]}} into a hidden <div></div>.

How do I separate the row containing the buttons from the rest of the table rows and put it in the form-footer.


Kind regards,

Annet

Annet

unread,
May 25, 2012, 2:01:27 AM5/25/12
to web...@googlegroups.com
I made a little progress:

<div class="form-header">

</div>

<div class="form-body">
{{=form.custom.begin}}
{{=form.element('table')}}
</div>

<div class="form-footer">
{{=form.custom.end[1]}}
{{=form.custom.submit}}
<input class="btn" type="button" value="Cancel" onclick="javascript:history.go(-1);">
{{=form.custom.end[0]}}
</div>

The problem is that {{=form.element('table')}} also contains the submit and cancel button, and that the submit button in the form-footer doesn't work.

Is there a way to solve this problem?

Annet

Massimo Di Pierro

unread,
May 25, 2012, 10:04:31 AM5/25/12
to web...@googlegroups.com
replace

{{=form.element('table')}}

with

{{ del form.element('table')[-1]}}
{{=form.element('table')}}

Annet

unread,
May 25, 2012, 2:22:10 PM5/25/12
to web...@googlegroups.com
Massimo,

Thanks for your reply, it solved the first part of the problem. I am left with a submit button that doesn't work:

In the view:

{{=form.custom.submit}}

In the browser:

<input type="submit" value="Login" class="btn btn-primary">


Do I have to add any code to get this to work?


Kind regards,

Annet

Massimo Di Pierro

unread,
May 25, 2012, 3:54:57 PM5/25/12
to web...@googlegroups.com
What do you mean by does not work?

Annet

unread,
May 27, 2012, 1:31:48 AM5/27/12
to web...@googlegroups.com

What do you mean by does not work?

When I click the submit button, the form isn't being submitted.


Kind regards,

Annet.

Annet

unread,
May 28, 2012, 2:20:31 AM5/28/12
to web...@googlegroups.com
I had to remove {{=form.custom.end[1]}} and change {{=form.custom.end[0]}} to {{=form.custom.end}} to solve the problem.

Annet.
Reply all
Reply to author
Forward
0 new messages