Jump to content
php.lv forumi

PHP + FORM + JS


Mikijs

Recommended Posts

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

×
×
  • Create New...