How can i end up with two values after submit okay i was wondering how can i have the hidden value and another value containing the div text?? the reason why it because im going to insert both of those values in different variables to insert into a mysql query
html code:
<form action="" method="POST" onsubmit="return insert_value()">
<input id="hidden_data" name="data" type="hidden" value="<?php $user_id ?>"/>
<div id="showing_data" class="commenttext" contenteditable="true"></div>
<input type="submit" value="Submit" id="submitthis" />
</form>
Javascript CODE:
function insert_value()
{
var values = [];
values.push(document.getElementById('hidden_data').value);
values.push(document.getElementById('showing_data').textContent);
console.log(values);
return true;
}