Hi there!
I have this function in jQuery that is suposed to toggle a div, according to each different record I click, in order to toggle an upload form. However I can't seem to get it to work properly.
Anyone could help? I really need this working today :(
jQuery Script
$(document).ready(function() {
// hides the slickbox as soon as the DOM is ready
$('div.upload').hide();
// shows the slickbox on clicking the noted link
$('div.upimagem').click(function() {
$(this).parents().next('div.contentor_upload').toggle("slow");
return false;
});
});
The records coming from the DB and the DIV that needs toggling
echo'<div class="etiquetas">';
echo '<div class="tit_etiq">';
echo $titulo;
echo'</div>';
echo'<div class="botoes_comando">
<a href="#"><div class="visualiza" id="visualiza"></div></a>
<a href="view.php?id='.$id.'"><div class="edita"></div></a>
<a href="../crud/delete.php?id='.$id.'&mod='.$table.'"><div class="elimina" id="delete"></div></a>
// WHEN YOU CLICK THIS LINK "upimagem" THE DIV TOGGLES
<a href="#"><div class="upimagem"></div></a>
</div>';
echo'</div>
<div class="contentor_visualiza" id="contentor_visualiza'.$id.'">
<?php $table = "content_empresa";?>
<div class="view">
<form name="edita_records" method="POST" action="../crud/insert.php?mod=<?php echo $table ?>">
<textarea class="area_titulo_view" name="titulo_emp" readonly="readonly">';
echo $titulo;
echo'</textarea>
<textarea class="area_visualiza" name="content_emp" readonly="readonly">';
echo $descricao;
echo '</textarea>
</form>
</div>
</div>
/* THIS IS THE DIV THAT SHOULD BE TOGGLED */
<div class="contentor_upload">
<div class="upload">
<form name="upload_imagem" method="post" enctype="multipart/form-data" action="../upload/upload.php?id_int='.$id.'&mod='.$table.'">
<input type="file" name="image">
<input name="submit" type="submit" value="Upload">
</form>
</div>
</div>';
}
echo '</div>';
Glad for all the help possible