Forums

__N__ multiplier

ideagrup 26 Jul, 2015
Hellooo, Bob & Max

I finally managed to send multiple mails correctly. I have only a small problem. in the form there is a field in braces within a text area but does not display the contents of the field. It is possible somehow ??

I've try:

{model.__N__.myfield}
{model.[__N__.myfield} and more. No running.

Only its running if I put {model.0.myfield} but I need the value for each record.

Do you know like putin text area multiplier value??

THOMAS
GreyHead 27 Jul, 2015
Hi Thomas,

I've never tried to do that - using PHP might help <?php echo $form->data['model'][__N__]['myfield']; ?>

If not perhaps you can use custom code to copy the value you need to another entry in the $form->data[''] array???

Have you added a debugger to see what data is available and what it is called?

Bob
ideagrup 27 Jul, 2015
Yes, I've added a debbugger to see what data is available.

But the data is a typical data array:
[model]
[0]
[field1]
[field2]
[1]
[field1]
[field2]


I dont know what is the variable to control the row number: [0][1][2] .. [N]
I thoutght that was __N__ but is only available into multiplier NO in custom code SETUP

Thomas
GreyHead 27 Jul, 2015
Hi Thomas,

If you add a Hidden Input to the Multiplier (or a Custom code element with the HTML in it) then you can track the id
<?<input type='hidden' name="model['__N__']['m_id']" value='__N__' /> 
That should add the id value to the array so that you can use it.

Bob
ideagrup 27 Jul, 2015
but is posible track into the text area??

Into a text area i put
{model.[element array].field}

the proble is this -> the reference element array

if i add a hidden input with <?<input type='hidden' name="model['__N__']['m_id']" value='__N__' />

the reference a this new field can not put it in the sentece: {model.[element array].field}
GreyHead 27 Jul, 2015
Hi Thomas,

It's not clear to me what you need to do. If you have that Id available then you can probably use Custom code to put it wherever you need it after the form submits.

Bob
ideagrup 27 Jul, 2015
Is this exactly

SAMPLE FORM
(fields)

othermodel[me] hidden text comes of other database
othermodel[textarea] hidden text area comes of other database.with this content:
" hello friend {model.__N__.namefriend}, I am {othermodel.me} and this the rest of content. "

Multiplier zone (Model:model)
(fields)
model[__N__][mailfriend]
model[__N__][namefriend]
model[__N__][otherfield]
model[__N__][textarea] -> this is a copy of othermodel[textarea]

end Multiplier

and the results are:
_________________________
mailfriend1@example.com
John Smith
hello friend {model.__N__.namefriend}, I am Thomas and this the rest of content.
______________________
mailfriend2@example.com
Peter Gabriel
hello friend {model.__N__.namefriend}, I am Thomas and this the rest of content.
_______________________
mailfriend3@example.com
Peter Ustinov
hello friend {model.__N__.namefriend}, I am Thomas and this the rest of content.

_______________________

I would like replace {model.__N__.namefriend} for the content field like the other.

I explain correctly??

My english is very bad. Im sorry Bob.
GreyHead 27 Jul, 2015
Hi Thomas,

I don't think that will work in the textarea before the form submits as there is no value set to submit. You'd have to put a marker in there e.g. ##name## and replace it after the form submits before you send the emails.

Alternatively you could do it with JavaScript when the name is entered. That's possible but using JavaScript with Multipliers isn't very straight-forward.

Bob
ideagrup 27 Jul, 2015
Ok, then

I dont include into text area. I will put adding fields.

Thaks Bob for all.

I am learning so much.

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