Sequential Order Of Checkboxes Selected Php March 02, 2024 Post a Comment At the moment, my html code is: hostSolution 1: you'd need to add a some javascript to get that info.<inputtype="hidden"name="order"/><!-- goes inside the form -->CopyHere is an examply using jQuery:$('[name*="col_list"]').change(function(){ if ($(this).prop('checked')){ $('[name="order"]').val($('[name="order"]').val()+','+$(this).val()) } }); CopyThis should work fairly well with one caveat: If the user un-checks then re-ckecks a checkbox it will be added to order twice.order should result in something like:,host,atom_name CopyEditBaca JugaWhat Is The Correct Way To Open A Form Submit In A New Window Now Target Is DeprecatedJavascript - Get The Filename And Extension From Input Type=fileHow To Save Html5 Geolocation Data To Python Django Admin?Fixed some typos and here is a fiddleSolution 2: If the order is important you will have to implement some form of JavaScript or AJAX and call it when the check boxes are checked. Forms do not track the order in which fields are filled. JavaScript is well suited to this because it can trigger at the time of the click. An alternative to AJAX could be adding a hidden field element and using JS to store the order clicked. Then it would be passed when the form is clicked. Share You may like these postsImage Height In Flexbox Not Working In IEAdd Data From Html Form To A Sql Database Using PHPHow To Get At This DataDrop Down List Items Still Clickable When The Opacity Is Zero Post a Comment for "Sequential Order Of Checkboxes Selected Php"
Post a Comment for "Sequential Order Of Checkboxes Selected Php"