I have an array of checkbox that is populated with data from mysql database through a query. I can submit the value of the checked checkbox into a table from a database. But I want it to be saved according to the sequence the checkbox was checked by the user. I was told that I can achieve this through javascript but I'm not that familiar with javascript. Can you please guide me on how to do this? Any help will be appreciated. Thanks a lot!
xjshiya
8
Light Poster
Recommended Answers
Jump to Postsubmit your code then we may able to help you.
Jump to PostI am adding hidden field for each icode next to check box
<?php for (..) { <input name=prod[] type=checkbox value='$pr' onclick='javascript:setorder(this);'> <input name='cd-$pr' id='cd-$pr' type=hidden value=''> } ?>
now I am adding java script at the end of page
<script lang='javascript'> var chkorder=1; …
All 7 Replies
urtrivedi
276
Nearly a Posting Virtuoso
xjshiya
8
Light Poster
urtrivedi
276
Nearly a Posting Virtuoso
xjshiya
8
Light Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
Airshow
416
WiFi Lounge Lizard
Team Colleague
urtrivedi
276
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.