At the beginning of my PHP page I have a form with a save (submit) button. Below I draw a list of items which are from the db. I now want the user to be able to tick the items he wants to select. My problem: All the information is outside my form. How can I access the generated information?
<form method="post" action="">
<input type="submit" name="save" class="inputButton" value="Save" />
</form>
PHP function below:
drawArticles($id, $option, $credit);
Contents of PHP function drawArticles():
..CONTENTS REDUCED..
echo "<div class='groupsTickbox' name='".$aid."'><input type='checkbox'></div>";
echo "<div class=\"divListGroups\">";
..CONTENTS REDUCED..
You MUST insert all form elements in
<form>tag if you want them to be automatically included in POST request. Otherwise, you’ll need to manually code JavaScript onSubmit() handler to include values of those DOM nodes to the form request. You can surround whole page with<form>elements, if that matters.