Jump to content
php.lv forumi

PHP + FORM + JS


Recommended Posts

Posted

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

Posted
<input type="checkbox" name="checkbox_1" id="checkbox_1" value="1" style="display: none" />
<label for="checkbox_1">check it!</label>

Posted

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>

Posted

		<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..

Posted (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 by Vebers
Posted

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

Posted

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.

×
×
  • Create New...