Answer the question
In order to leave comments, you need to log in
How can a div be saved?
The question is rather crooked.
There is a button that adds an unlimited number of divs
$(function(){
var count = 0;
$('#append').click(function(){
$('#parent').append('<div style="width:840px;" id="first'+count+'"> тут содержимое дива </div>');
count++;
});
});
Answer the question
In order to leave comments, you need to log in
it is natural to save in the database
to do it like this:
<form ...>
<div ...><input name="values[]" ...></div>
</form>
<form ...>
<div ...><input name="values[]" ...></div>
<div ...><input name="values[]" ...></div>
</form>
<?php
//скрипт в который происходит submit
...
$values = implode(";", $_POST["values"]);
//сохранить в базу строку $values
?>
//скрипт отображения form-ы
<form ...>
<?php
//достать $values из базы
$arr = explode(";", $values);
for ($arr as $value)
{
echo "<div><input name=\"values[]\" value=\"$value\" /></div>";
}
?>
<imput type="submit" />
</form>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question