Results 1 to 2 of 2
Nov 9, 2011, 01:29 #1
- Join Date
- Oct 2011
- 0 Post(s)
- 0 Thread(s)
To save Multiple div values with the same name using php and mysql
How to save multipple div values with the content editable feature with the same name in database using php.
The user can click the div element as many times as he/she wants and can enter the values in the text boxes(that is a small div boxes). Once the user clicks the submit button, all the values that he/she entered should be saved in the database.
I have written code like this to display the box and was working fine.
$board.append('<div class="class1" style="left:20px;top:70px"><div contenteditable class="editable" name = "content"></div></div>');
and the next code with be with a different class outside but the same name inside.
$board.append('<div class="class2" style="left:20px;top:70px"><div contenteditable class="editable" name = "content"></div></div>');
The user can create as many div values as he/she wants.
How to call these values in array using php and save it in the database.
I was able to do the same with the text values with the name of the text box, but when i tried to do the same, i could not run it and was showing error.
I would be glad if somebody could help me out with code.
Nov 9, 2011, 03:42 #2
- Join Date
- Mar 2006
- 7 Post(s)
- 1 Thread(s)
You'll need to copy the values from the contenteditable divs into a form input (probably a textarea is best) before submitting the form.
Then, you can access them using the $_POST superglobal.