0
I’m trying a kind of reverse engineering with the use of PHP, Javascript and Mysql query. I am creating an event editing form registered in a bank table.
In one of the fields, called Presence List, here is how it brings in the HTML form the value of the field listed presence within the div numPart:
<div class="BoxForm1" id="nomeParticipante">
<br>
<div id="numPart">
<?php foreach ($data['evento'] as $evento){ echo $evento['listapresenca']; } ?>
</div>
<input type="hidden" name="part_text" id="part_text" value="" />
</div>
In the form that inserts a new data, the attendance list is composed of one or more textbox, depending on how many participants the event will have. Normally the field is registered as follows:
Name 1
Nome 2
Name 3
...
Name 10
What I wanted was a way to transform the text of the attendance list (the text of the div numPart) in various textboxs, each going from name to new line sign
How can I do?
When you say 'TEXTBOX' you would be referring to
<input type="textbox">
? or just want to create a 'box' that will receive the list of participants?– Adriano Luz
echo '<input type="text" value="'. $event['presenca']. '" /><br>';
– Dalton Menezes
@Adrianoluz is the input textbox yes
– Gustavo Hoppe Levin
@Daltonmenezes OK, but how can I do for more of a name saved in this field?
– Gustavo Hoppe Levin
I need you to explain this better. Where would the other name be? What variable is it?
– Dalton Menezes
echo '<input name="presenca[]" type="text" value="'. $event['presenca']. '" /><br>'; Picks up the presentlist name by POST/GET where this is an array;
– Mayron Ceccon
@Daltonmenezes For example, if in my table the field is stored as follows: "Name 1<br>Name 2<br>Name 3<br>". In this case it will be necessary to transform into three textbox. One containing Name 1, the other containing Name 2 and the third containing Name 3. Or as Mayron Ceccon said, if there was a way to transform into array,
– Gustavo Hoppe Levin
I figured out how to do, I’ll put the solution in a new post of this topic.
– Gustavo Hoppe Levin