submit form with checkbox

218 views
Skip to first unread message

Josch

unread,
Aug 16, 2009, 9:50:06 PM8/16/09
to Discuss jquery.dynatree.js
Hello, everyone!
I want to use dynatree with checkbox,
but I don't know how to submit form with dynatree.
Checkbox always has a attribute called value, but where can I put that
on?
Sorry for my poor English ability, and thank you for your answer.

Josch

unread,
Aug 16, 2009, 10:44:07 PM8/16/09
to Discuss jquery.dynatree.js
I forgot to say,
I'm using <ul> element and data is output from PHP.

milan....@centrum.cz

unread,
Aug 18, 2009, 3:46:37 AM8/18/09
to Discuss jquery.dynatree.js
Simply add <form action="your_script.php" method="post"> before
dynatree <ul> tag and </form> after your tree. You also need to append
<input type="submit" name="send" value="Sumbit" /> somewhere inside
the form to submit the selected values. In your_script.php you will
access the values with $_POST variable. You can dump it by var_dump
($_POST) to clearly see the result.
Hope this is what you meant.

Hias

unread,
Sep 23, 2009, 2:06:21 PM9/23/09
to Discuss jquery.dynatree.js
I face the same problem at the moment.
Same like Josh:
Tree with <ul> and I also want to submit the checked values via POST.

The problem is, I can't retrieve the values, because they are not
posted the the target script.
Here is my example:
<form action="/role/list" method="post">
<div id="tree">
<ul>
<li id="key1">Item 1</li>
<li id="key2">Item 2</li>
<li id="key3" class="folder">Folder 3
<ul>
<li id="key3.1">Sub-item 3.1</li>
<li id="key3.2">Sub-item 3.2</li>
</ul>
</li>

<li id="key4" class="folder">Folder 4
<ul>
<li id="key4.1">Sub-item 4.1</li>
<li id="key4.2">Sub-item 4.2</li>
</ul>
</li>
</ul>
</div>
<input type="submit" value="Senden" name="submit" />
</form>

Is there anything to be defined in the <HEAD>-Script?
What am I doing wrong?

Regards,
Hias
Reply all
Reply to author
Forward
0 new messages