Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
I have a repeatable region defined in the members module. I need to add records to this repeatable region programatically based on the submissions of a form. For various design reasons I cannot use bound forms.

Is there a way to add an entry into a repeatable field in this way?
I am afraid, I don't think it'd be possible without using a DataBound Form to shuttle data.

Repeatable regions are a 'collection' of individual editable regions so, I am sure you'll understand, it'd be too complex to represent the input data as a single string (we could have used some representation like JSON etc. but image trying to craft that in cms:form success condition using Couch tags).
I might be able to handle this with a little bit of AJAX. I'm thinking I can use Javascript to create the DataBound form and submit it behind the scenes where a user won't even know.

Is there a way to AJAXify a DataBound form? I'm not sure its possible given that DataBound forms seem to be generated by Couch in the first place.
Is there a way to AJAXify a DataBound form? I'm not sure its possible given that DataBound forms seem to be generated by Couch in the first place.
AJAXifying any Couch template is no big deal - create a template with only the databound form and call it via jQuery.

Since in this case you would want the template called via AJAX to return only a success or failure value (instead of markup for the full form), you can wrap up the form within cms:capture tags (please see docs if this is new for you) to control what gets outputted.

The tough thing would be to submit POST data to that form in a format that it expects - if I understood you right, you'll try to create this data on the fly using JS and submit it to the DataBound form.

It can be done if you play around a little submitting the real DataBound Form and studying the $_POST array's structure that is received by the server.

Hope this helps.
Absolutely, thanks for the help. I'll see what I can do with the $_POST info and submitting it to the form.
5 posts Page 1 of 1