Jump to content

Creating new repeater items through front-end form


onjegolders
 Share

Recommended Posts

Was just wondering if anyone had any experience adding repeater items to a new page from a front-end form?

The repeater consists of two fields, one a page field and the other a simple text value.

I'm unsure how I'd go about adding those values on a new page save()?

Thanks, as always.

Link to comment
Share on other sites

Thanks Ryan

I ended up using a combination of jquery append (and remove) and the following for loop in PHP.

$total = 0;

for ( $i=0;$i<count($input->post->invoice_billable);$i++) {
${'rp'.$i} = $page->invoice_line->getNew();
${'rp'.$i}->invoice_billable_line = $input->post->invoice_billable[$i];
${'rp'.$i}->invoice_billable_amount = $input->post->line_value[$i];

In case that helps anyone out.

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...