This topic is locked

Dynamically Include A New Field In Add Page

2/25/2013 2:25:31 PM
PHPRunner General questions
M
marthins author

Hello,
I want to add custom fields to my add page and include itens details for my order. It´s not a problem to create a new line with a field, I am using javascript to include a new field after click on the link: <INPUT type=text name=itens[]> <A class=adicionarCampo href="#">Add Itens</A>

But I don´t know how to get this field in event code, I tried to use $_REQUEST["itens"] but did not work.

Can anybody help me?
Regards
Marthins

Admin 2/25/2013
M
marthins author 2/26/2013

I have already tried to use this code, but this only works for one field. I am trying to include additional fields dynamically:
<INPUT type=text id=telefone[]/> <A class=adicionarCampo href="#">Add Telephone</A>
I use a javascript code (adicionarCampo) to include dynamically a new text field telefone. When using a regular html form, I can access the value of telefone field as an array in any PHP code, but I don´t know how to handle the information inside the PhpRunner application.

I tried to access the array using $_REQUEST["telefone"], but did not work.
Regards
Marthins

Admin 2/27/2013

Check this article one more time: http://xlinesoft.com/phprunner/docs/add_custom_field_to_form.htm
The second part of the article explains how to make sure new field is submitted with the rest of the form. You need to perform this operation for each new field you add dynamically.