Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript > Bibliothèques & Frameworks > jQuery
jQuery Forum d'entraide sur le framework jQuery. Avant de poster : Tutoriels jQuery, FAQ jQuery, Tous les tutoriels JavaScript, Toutes les FAQ JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 13/10/2011, 16h27   #1
 
atef atef
Inscription : janvier 2010
Messages : 28
Détails du profil
Informations personnelles :
Nom : atef atef

Informations forums :
Inscription : janvier 2010
Messages : 28
Points : -2
Points : -2
Par défaut Fancybox: retourner les id ou nom des chedkbox

Bonjour,
j'ai fais une modal en fancybox ... je l'ai ajouté des checkbox, mais le probleme c'est que j'arrive pas à avoir les id ou les 'name' des checkbox selectionner!!! alors quelqu'un à une idée?
voici mon code:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
		$(document).ready(function() {
 
			$("#various1").fancybox({
		'hideOnContentClick'		:false,
		'padding'			: 0,
		'overlayColor'			:'#999999',
		'transitionIn'			:'elastic',
		'transitionOut'			:'elastic',
		'overlayOpacity'		: 0.7,
		'zoomSpeedIn'			: 200,
		'zoomSpeedOut'			: 200,
		'overlayColor'			:'#D3D3D3',
		'padding': '20',
		'margin' : '10',
		'showCloseButton' : true,
		'overlayColor' :	'#666',
		'titlePosition'    	: 'over',
		'type': 'inline',
 
			});
 
		});

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
<a id="various1" href="#inline1" title="Veuillez choisir"><font color="#0066FF" size="2"><?PHP echo getTranslatedString('OBJET_IMPACTE');?></font></a>
 
 
	<div style="display: none;">
		<div id="inline1" style="width:800px;height:75px;overflow:auto;">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr  class="dvtLabel">
	<td> <input id="" type="checkbox" name="Objet1" value="Instance ou chaine" />   </td><td >	Instance ou chaine	</td>
 
	<td > <input type="checkbox" name="Objet3" value="Au moin un service"  />   </td><td>	Au moin un Service	</td>
	<td> <input type="checkbox" name="Objet4" value="Au moin un noeud" />   </td><td>	Au moin un noeud	</td>
	</tr>
	<tr  class="dvtInfo">
 
	<td > <input type="checkbox" name="Objet5" value="DataServer Innaccessible" />   </td><td>	Data Server Innaccessible	</td>
	<td > <input type="checkbox" name="Objet6" value="Client Innaccessible" />   </td><td>	Client Innaccessible	</td>
	<td > <input type="checkbox" name="Objet7" value="Agenda" />   </td>	<td>	Agenda	</td>
 
	</tr>   
		</table>
		</div>
lordatef est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/10/2011, 16h35   #2
Responsable Développement Web

 
Avatar de Bovino
 
Homme Didier Mouronval
Développeur Web
Inscription : juin 2008
Messages : 13 807
Détails du profil
Informations personnelles :
Nom : Homme Didier Mouronval
Âge : 41
Localisation : France, Gironde (Aquitaine)

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : juin 2008
Messages : 13 807
Points : 35 789
Points : 35 789
1) Ton problème a-t-il vraiment un rapport, même lointain, avec AJAX ?

2) D'ailleurs, ton problème, c'est quoi au juste ? Parce que ton explication est loin d'être claire...
__________________
Pas de question technique par MP !
Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
Vous possédez un blog et aimeriez diffuser vos billets sur le forum, contactez-moi !
Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
Mon livre sur jQuery
Bovino est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/10/2011, 16h46   #3
 
atef atef
Inscription : janvier 2010
Messages : 28
Détails du profil
Informations personnelles :
Nom : atef atef

Informations forums :
Inscription : janvier 2010
Messages : 28
Points : -2
Points : -2
D'accord,
Alors tout simplement je veux savoir comment avoir les id ou les noms des checkbox selectionner dans un modal creer en Francybox
lordatef est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/10/2011, 22h31   #4
Rédacteur
 
Avatar de danielhagnoul
 
Homme Daniel Hagnoul
Étudiant perpétuel
Inscription : février 2009
Messages : 3 221
Détails du profil
Informations personnelles :
Nom : Homme Daniel Hagnoul
Âge : 61
Localisation : Belgique

Informations professionnelles :
Activité : Étudiant perpétuel
Secteur : Enseignement

Informations forums :
Inscription : février 2009
Messages : 3 221
Points : 6 767
Points : 6 767
Bonsoir

<input id="" type="checkbox" name="Objet1" value="Instance ou chaine" />.

Un ID doit commencer par un caractère alphabétique et être unique dans la page web.

Exemple :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div id="inline1" style="width:800px;height:75px;overflow:auto;">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr  class="dvtLabel">
			<td><input id="inputID" type="checkbox" name="Objet1" value="Instance ou chaine" /></td>
			<td>Instance ou chaine</td>
			<td><input type="checkbox" name="Objet3" value="Au moin un service"  /></td>
			<td>Au moin un Service</td>
			<td><input type="checkbox" name="Objet4" value="Au moin un noeud" /></td>
			<td>Au moin un noeud</td>
		</tr>
		<tr  class="dvtInfo">
			<td><input type="checkbox" name="Objet5" value="DataServer Innaccessible" /></td>
			<td>Data Server Innaccessible</td>
			<td><input type="checkbox" name="Objet6" value="Client Innaccessible" /></td>
			<td>Client Innaccessible</td>
			<td><input type="checkbox" name="Objet7" value="Agenda" /></td>
			<td>Agenda</td>
		</tr>   
	</table>
</div>
 
<button id="btn">Infos</button>
Code :
1
2
3
4
5
$("#btn").click(function(){
	$("input[type='checkbox'][name^='Objet']:checked").each(function(i, item){
		console.log("i = ", i, "item = ", item, "id = ", item.id, "name = ", item.name );
	});
});
__________________

FAQ jQuery

Mon cahier d’exercices sur jQuery & Co

Si un message vous a aidé ou vous semble pertinent, votez pour lui !
danielhagnoul est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 05h07.


 
 
 
 
Partenaires

Hébergement Web