 Phil. World Chat Champion

Joined: 02 Feb 2002 Karma :     
|
|
 Kickstart The Oracle

Joined: 04 Feb 2002 Karma :     
|
 Posted: 22:57 - 22 Jun 2010 Post subject: |
 |
|
Hi
Think using hidden fields populated when the checkboxes are ticked would be how I would do it. Down side is that it means it only works if they have javascript enabled (if that matters to you).
Difficult bit is faffing round removing items when they uncheck a check box.
Failing that simulate a pair of list boxes, one for possible fields and the other for selected fields. Click to move between them (or drag and drop is you are feeling flash). When the form is submitted copy the selected fields to an array of hidden fields to pass back to the server.
All the best
Keith ____________________ Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing |
|
 Phil. World Chat Champion

Joined: 02 Feb 2002 Karma :     
|
 Posted: 13:00 - 23 Jun 2010 Post subject: |
 |
|
Hey Kieth, thanks for the response.
Ended up using a hidden field. Had contemplated using drag an drops but was concerned it was adding an extra step.
So anyway, incase anyone ever stumbles on this one day and wants some code to look at:
Using the $F function from the prototype Library
| Code: |
<script type="text/javascript">
function doc_write($name){
document.getElementById('test').value=$F('test') + $name + '-';
}
</script>
<input type="checkbox" onclick="doc_write('some_name')" name="some_name">
<input type="hidden" id="test" name="test" value=""/>
|
Then I guess I will explode the '-' from $_GET['test'] and loop through those to get the order. Deleting duplicates along the way. |
|
 Kickstart The Oracle

Joined: 04 Feb 2002 Karma :     
|
|