Mikijs Posted February 18, 2008 Report Posted February 18, 2008 Iedomajamies situaciju kad mums ir shads skripts <label><div style="display: none;"><input type="checkbox" value="1"></div> <input type="image" class="button" name="Dzēst"></label> Jau laikam redzams ko velos panakt, bet nevaru atrast =/ tip nospiezot pogu DZEST atzimejas [checkbox] un izpilda submit funkciju
Sasa Posted February 18, 2008 Report Posted February 18, 2008 paliec ar JS zem submit pogas click eventa check box'a iečeksēšanu!
andrisp Posted February 18, 2008 Report Posted February 18, 2008 Javascript. Un vispār izskatās pēc muļķīga risinājuma.
Vebers Posted February 18, 2008 Report Posted February 18, 2008 <input type="checkbox" name="checkbox_1" id="checkbox_1" value="1" style="display: none" /> <label for="checkbox_1">check it!</label>
Mikijs Posted February 18, 2008 Author Report Posted February 18, 2008 Vispar es gribetu linku [dzest] =/ Man sobrid ir <td class="leftAlign"><label><div style="display:none;"><input type="checkbox" name="delattachments[]" value="<?php echo $file_num ?>" /></div> <input type="image" value="Dzēst" class="button"></label></td> Originals <td class="leftAlign">Delete? <input type="checkbox" name="delattachments[]" value="<?php echo $file_num ?>" /> <input type="submit" value="reload" class="button"></td>
Vebers Posted February 18, 2008 Report Posted February 18, 2008 Nu un kur problēma? Checkboxim norādi ID un <labed for="checkbox_id"></label>
Mikijs Posted February 18, 2008 Author Report Posted February 18, 2008 <td class="leftAlign"><div style="display:none;"><input onchange="uniqSubmit('add_attachment');" type="checkbox" name="delattachments[]" value="<?php echo $file_num ?>" /></div> <label for="delattachments[]">[<a href="#">Dzēst</a>]</label></td> <td class="leftAlign"><div style="display:none;"><input onchange="uniqSubmit('add_attachment');" type="checkbox" name="delattachments[]" value="1" /></div> <label for="delattachments[]">[<a href="#">Dzēst</a>]</label></td> <td class="leftAlign"><div style="display:none;"><input onchange="uniqSubmit('add_attachment');" type="checkbox" name="delattachments[]" value="2" /></div> <label for="delattachments[]">[<a href="#">Dzēst</a>]</label></td> <td class="leftAlign"><div style="display:none;"><input onchange="uniqSubmit('add_attachment');" type="checkbox" name="delattachments[]" value="3" /></div> <label for="delattachments[]">[<a href="#">Dzēst</a>]</label></td> Problema ir tur ka NAME ta ir viens, bet values ir dazadas..
andrisp Posted February 18, 2008 Report Posted February 18, 2008 Labela for jāattiecas uz elementa ID. Izvadot sarakstu, ģenerē unikālus ID katram input elementam.
Vebers Posted February 18, 2008 Report Posted February 18, 2008 (edited) Nu es tak saku ID nevis NAME!! un pec post padosanas sanjemsi visus laukus ar vienadu name ka masiivu. Taka ģenerē unikālus ID katram label`im un checkbox`im. Edited February 18, 2008 by Vebers
Mikijs Posted February 18, 2008 Author Report Posted February 18, 2008 ir strada :) <td class="leftAlign" valign="middle"><strong>Iespējas</strong> </td> <td class="leftAlign"><div style="display:none;"> <input id="<?echo $file_num;?>" onchange="uniqSubmit('add_attachment');" type="checkbox" name="delattachments[<?php echo $file_num ?>]" value="<?php echo $file_num ?>" /></div> <label for="<?php echo $file_num ?>"> [<a onclick="">Dzēst</a>]</label></t
marcis Posted February 18, 2008 Report Posted February 18, 2008 Kā parasti - neredzu jēgu šādam risinājumam. Ja gribi dzēst vienu failu, tad bez problēmām caur $_GET var padot. Ja gribi dzēst vairākus failus, tad kur te jēga no <label> ? Godīgi sakot man tas kods šķiet pornogrāfisks.
Recommended Posts