[eluser]Pr0v4[/eluser]
Ok, I've tried for few days some different solutions but no one looks work properly.
All that I would like to do is retrieve a test from my db (np), show the test (np) and insert a new mark test (and here at the moment i cannot success...)
My idea is something produce this kind of HTML:
Code:
<form method="post" action="http://localhost:8888/TestYourSkills/tysk/ci/index.php/test/insert">
<div id="quest_field_1" class="quest_field">
<p>Question 1: </p>
<input type="hidden" value="quest_field_1" name="quest_field_1"/>
<label for="ans_field_1">yes</label>
<input id="ans_field_1" type="checkbox" value="1" name="ans_field_1"/>
<label for="ans_field_2">no</label>
<input id="ans_field_2" type="checkbox" value="2" name="ans_field_2"/>
</div>
<div id="quest_field_2" class="quest_field">
<p>Question 2: </p>
<input type="hidden" value="quest_field_2" name="quest_field_2"/>
<label for="ans_field_3">maybe</label>
<input id="ans_field_3" type="checkbox" value="3" name="ans_field_3"/>
<label for="ans_field_4">probable</label>
<input id="ans_field_4" type="checkbox" value="4" name="ans_field_4"/>
</div>
<input type="submit" value="Submit Test" name="submit"/>
</form>
When my user will press the submit button i would like insert on my db
only the checkbox that have been checked. with the solution
Quote:$field_count = count[$_POST];
I've ALL the value that are been sent, but i don't wont that...
I'm sorry to bother you guys, but to realize my application I have to define this behavior, and also it's the first time that i find myself fighting with a proper form, until now I always need them to create mail form
Also I would like to check that for wach question, the user can send only
one answer...
Can you at least give me something to read???
Thanks in advance!