darksniperx Posted November 26, 2007 Share Posted November 26, 2007 What I would like to do this. I need to create a way to generate html code with a button click. For example, I would like to create a list of people's name with their emails and remove any of them at any time. part of the code would look something like this: <a href="javascript:add();">Add Field</a> <div id='people'> Name:<input type='text' name='name[]' /> Email:<input type='text' name='email[]' /><a href="javascript:remove();">Remove Field</a><br/> </div> When ever someone clicks add field, the code adds the following line inside div tag When ever someone clicks remove field, the code will remove that its line from div tag. the second part, is that I would like to pass the array to of name and email to php and work with them foreach($_POST['name'] as $name, $_POST['email'] as $email) { // do the following } and also that they would be synchronized together, that email would belong to the to its name and not to any other onces in the array. Link to comment https://forums.phpfreaks.com/topic/78980-creating-and-passing-an-array-from-input-tag-to-php/ Share on other sites More sharing options...
phpQuestioner Posted November 26, 2007 Share Posted November 26, 2007 Try this forums; they can probably help you out better with what your wanting to do. http://www.phpfreaks.com/forums/index.php/board,51.0.html Link to comment https://forums.phpfreaks.com/topic/78980-creating-and-passing-an-array-from-input-tag-to-php/#findComment-399723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.