Selection de la class suivante
Posté : 06 déc. 2011, 04:29
Bonjour,
Comment puis je selectionner la class suivante du button input selectionne:
merci d'avance
Comment puis je selectionner la class suivante du button input selectionne:
<?php
echo '<span>';
echo '<input type="radio" class="isSkills" name="'.$idq.'" value="answer1" /> '.$answer1.'<br />';
echo '</span>';
echo '<span class="isError"></span>';
echo '<span>';
echo '<input type="radio" class="isSkills" name="'.$idq.'" value="answer2" /> '.$answer2.'<br />';
echo '</span>';
echo '<span class="isError"></span>';
echo '<span>';
echo '<input type="radio" class="isSkills" name="'.$idq.'" value="answer3" /> '.$answer3.'<br />';
echo '</span>';
echo '<span class="isError"></span>';
?>
et le js:
Code : Tout sélectionner
$('input.isSkills').change(function(){
// load image
$('.loading').show();
var answer = $(this).val();
var idq = $(this).attr('name');
var dataString = 'answer='+ answer +'&idq=' + idq;
$.ajax({
type: "POST",
url: "Misc/isSkillsCheck.php",
data: dataString,
dataType: "json",
success: function(data) {
if(data.isSkillsCheck == 0){
$(this).parent().next('span.isError').html('<img src="Images/Icons/error.png" />');
}
//