I never figured out how to do it so I thought I'll just ask. I don't have any specific code, I have always worked around that problem but now I'm at a point where I have to somehow do it. Let's say I've got an array: $myarray = array('321', '54', '74', '13', '876'); Code (markup): Now I'm putting every value into a textarea: foreach ($array as $key=>$val) { echo '<textarea>'.$val.'</textarea>'; } Code (markup): Now my question: How can I make those values editable? With this array I've got 5 textareas. I can't give them the same name, so how to do it? It's for a shopping cart for editing the number of ordered items. I'm sure you know what I mean. PS. Yes, I know that I need to submit the forms and such, but didn't want to make a huge post.
$x = 1; foreach ($array as $key=>$val) { echo '<textarea name="Area'.$x.'">'.$val.'</textarea>'; $x++ } PHP:
Yes, thank You, but how do I check for changes after submitting the form? if (???? != $val[$i]) { PHP: EDIT: It doesn't have to be <textarea>, can be input or whatever else works. Anything that could print an unknown number of input fields and save the changes. ADDED: Ok, did it that way: foreach ($array as $key=>$val) { echo ' <form method="GET" name="form'.$key.'"> <input type="text" name="to" value="'.$val.'" /> <input type="submit" name="change" value="'.$key.'" /> </form> '; } PHP: