0
Voici mon code:Trouble with annexant un formulaire dans jQuery
$('.reply').click(function() {
$leftwrap = $(this).parent();
$comment = $(leftwrap).parent();
$id = $comment.attr('id');
if($(this).siblings('.reply-form').length == 0) { //check whether or not the form as been initiated yet
$(this).parent().append('<?php $replytimestamp = strtotime("now"); ?>
<form class="reply-form" action="/scripts/reply-process.php" method="post">
<input type="hidden" name="replytimestamp" value="<?php echo $replytimestamp; ?>">
<input type="hidden" name="replyto" value="'+ $id +'">
<label for="name" class="reply-label">Name</label>
<input type="text" name="name" class="reply-input">
<label for="message" class="reply-label">Reply</label>
<textarea name="message"class="reply-ta"></textarea>
<input class="reply-submit" type="submit" name="submit" value="submit" />
</form>');
$(this).siblings('.reply-form').hide();
$(this).siblings('.reply-form').slideDown();
} else $(this).siblings('.reply-form').slideToggle(); //if it is, toggle it
});
Chaque fois que je clique sur '.reply' rien ne se passe, aucune diapositive, rien. Je n'ai rien trouvé dans Firebug. Donc, une idée de quoi? Merci!!
ok, je n'ai jamais compris clairement quand utiliser le "$". Merci!! – williamg