form.custom('table')

Showing 1-7 of 7 messages
form.custom('table') Annet 5/22/12 10:21 PM
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
Re: form.custom('table') Annet 5/24/12 11:01 PM
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
Re: form.custom('table') Massimo Di Pierro 5/25/12 7:04 AM
replace

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

with

{{ del form.element('table')[-1]}}
{{=form.element('table')}}
Re: form.custom('table') Annet 5/25/12 11:22 AM
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
Re: form.custom('table') Massimo Di Pierro 5/25/12 12:54 PM
What do you mean by does not work?
Re: form.custom('table') Annet 5/26/12 10:31 PM

What do you mean by does not work?

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


Kind regards,

Annet.
Re: form.custom('table') Annet 5/27/12 11:20 PM
I had to remove {{=form.custom.end[1]}} and change {{=form.custom.end[0]}} to {{=form.custom.end}} to solve the problem.

Annet.