Hey all, using this method http://stackoverflow.com/questions/1501181/jquery-append-and-remove-element i'm adding text inputs to a document. i'm using this php
if($_POST['cp_slider']) { $array=$_POST['cp_slider']; foreach($array as $cp_slider) { if(strlen($cp_slider)>0){ echo '<li><input type="text" name="cp_slider[]" value="'.$this->options["theme_slider"].'" /><a href="#" class="remove_project_file" border="2"><img src="images/delete.gif" /></a></li>'; } } }
The value was created like this:
if ($_POST['to_action'] == 'save') {
$this->options["theme_slider"] = $_POST['cp_slider'];
update_option('artTheme', $this->options);
}
But what i see in the value of every input after submitting the form is: Array as a word.
UPDATE I figured it out and it's working fine. The value gets it's real value, i've just changed the foreach line
from this
foreach($array as $cp_slider)
to this
foreach($array as $this->options["theme_slider"])
But there is still one problem there. After i submit the form, the data from inputs submits very well. But when i go to another page with in the application and then i'm comming back to the page with this inputs, they are simply not there, they just disappear from the page.