Forums

multiplier problem with remove row button

admin_wiky 25 Jan, 2016
Hi Bob,

I have follow your FAQ about multiplier and have added CSS to my form:
.gbs3.multiplier-contents {
  background: none repeat scroll 0 0 #eee;
  margin-bottom: 6px;
  padding: 6px;
  position: relative;
}
.gbs3.multiplier-remove-button {
  position: absolute;
  right: 12px;
  top: 12px;
}

but nothing happend, button is still on left side of form.
can u tell me why?
GreyHead 25 Jan, 2016
Hi Homeopat,

Not from the information here. If you post a link to the form I might be able to see where the problem is.

Bob
admin_wiky 25 Jan, 2016
Hi Bob,
Here is the LINK
I did try to rename classes but with no result.
Thank You.
GreyHead 26 Jan, 2016
Answer
Hi Homeopat,

My mistake :-( I left out spaces after ,gbs3 in the FAQ. Please try this
.gbs3 .multiplier-contents {
  background: none repeat scroll 0 0 #eee;
  margin-bottom: 6px;
  padding: 6px;
  position: relative;
}
.gbs3 .multiplier-remove-button {
  position: absolute;
  right: 12px;
  top: 12px;
}

Bob
admin_wiky 27 Jan, 2016
Hi Bob,

thx 4 help, now it works.
May I one question about multiplier?

how can I save the date to column (e.g. cf_created)?
I did try something like this in custom code before submit action
$form->data['kontakty'][##]['cf_created'] = date('Y-m-d H:i:s');


but it doenst take an effect
thank you
GreyHead 27 Jan, 2016
Hi Homeopat,

Please try without the [##] - that shouldn't be needed.

Bob
admin_wiky 27 Jan, 2016
Hi Bob,

I did it, but then dont save data to second table after this modifikation.
data are stored to second table, when I remove this row
GreyHead 27 Jan, 2016
Hi homeopat,

In that case you presumably need to add a Custom code action to loop through the multiplier data and save the data to each entry.

Or you can change the column name in your table to created so that CF will save the data automatically.

Bob
admin_wiky 27 Jan, 2016
ok, but how I find how many entries (indexes) is in multiplier?

I did try delete existing record in second table over remove button in form, but no record from second table was removed. why?

thank you.
GreyHead 08 Feb, 2016
HI homeopat,

Count them - the length of the submitted array will tell you.

I'm not sure what you are trying it do with the deletion. To edit forms with a Multiplier you must include a record identifier in the data when it is loaded - and possibly also a list of the records loaded - and then check the submitted data carefully to see exactly what has been submitted. Data from deleted multiplier rows won't be submitted you yu would need to add custom code to check and delete the matching record.

Bob
This topic is locked and no more replies can be posted.