Hi. I have a problem and can't solve it... So I have web page there i can read and delete my messages. Each message has checkbox, if i want to delete messages i select which i want and put submit button. But i don't know how to say to coldfusion <cffile> tag which are selected... Can you help me?
I want to send "i" variable to cffile tag, where is mistake? <script type="text/javascript"> var checkboxes = document.getElementsByName( "ki"); for (i = 0; i < checkboxes.length; i++) { if (checkboxes.checked) { window.alert("checked") window.alert(i) document.write(("<cffile action="delete" file="C:\fd\i.jpg">")); } } </script>
You're mixing apples and oranges Javascript executes on the client side (browser) while CF code executes on the server side. To run the CFFILE code you need to submit another request to the server. The simplest method is to submit the form. Then on your action page use the form field variables to in combination with <CFFILE> to delete the files.