IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

comment actionner automatiquement la checkbox?


Sujet :

JavaScript

  1. #1
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut comment actionner automatiquement la checkbox?
    Bonjour, j'ai un formulaire du type et je veux que lorsque je clic sur l'oeil que la checkbox directement à gauche soit activé afin d'afficher l'image appropprié. jusqu'ici il faut d'abord cliqué sur la case approprié de la checkbox avant le clic sur l'oeil et ça marche mais je veux pouvoir le faire sans cliquer sur la checbox mais que ce soit fait directement par clic sur l'oeil. chaque oeil et chaque case de la checkbox qui sont sur la même ligne ont le même id. Voici le code correspondant à l'image avec l'oeil
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
     
        $check = pacsone_gettext("Check All");
        $uncheck = pacsone_gettext("Uncheck All");
        print "<input type='hidden' name='actionvalue'>\n";
     
     
     
     
    	      $key ='Show';
            $text = 'Show';
            $title = 'Show images of checked patients';
     
    			$cheminImage='oeil.png'; // les image doivent impérativement avoir le préfixe $key dans leur nom plus jpg
     
     
    		   $line = "<td ><input type=Image src=\"$cheminImage\" value='$text' name='action' id='$index' title='$title' "; // image transformé en bouton
                // applet-specific pre-Show handler
                if (strcasecmp($key, "Show") == 0) {
                    require "applet.js";
                    $handler = "switchText(this.form,\"actionvalue\",\"$key\"); return appletPreShow()";
                } else {
     
                   $handler = "switchText(this.form,\"actionvalue\",\"$key\")";
     
     
                }
     
                $line .= "onclick='$handler'></td>\n";
     
               print $line ;
     
     
     
        print "<td><input type=hidden value='$level' name='option'></td>\n";
        if (isset($hidden)) {
            foreach ($hidden as $name => $value) {
                print "<input type=hidden value='$value' name='$name'>\n";
            }
        }
    et celui correspondant à chaque case de la checkbox
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    print "\t\t<input type='checkbox' name='entry[]' id='$index' value='$data'>";
    il est dans un foreach. Mon but est de rajouter des ligne de code à l'évènement onclick de l'oeil pour pouvoir cocher la case appropriée et ainsi afficher mon image.
    Merci

  2. #2
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Bonjour,
    Citation Envoyé par sebac Voir le message
    je veux pouvoir le faire sans cliquer sur la checbox mais que ce soit fait directement par clic sur l'oeil.
    Dans le onclick de l'œil, ajoute
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    document.getElementById('id_de_la_checkbox').click();
    A+

  3. #3
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    merci pour l'aide mais j'essaye de le rajouter dans le code du dessus mais ça ne marche pas j'ai l'impression que je ne gère pas bien les les guillemet "" des chaines de caractères. Sinon je continu à essayer de positionner ton bout de code dans le mien.

  4. #4
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    J'ai essayé de faire ceci pour introduire le code de E.Bzz ça ne marche toujours pas voici la modif que j'ai faite
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
     
    	$check = pacsone_gettext("Check All");
        $uncheck = pacsone_gettext("Uncheck All");
        print "<input type='hidden' name='actionvalue'>\n";
     
     
     
     
    	      $key ='Show';
            $text = 'Show';
            $title = 'Show images of checked patients';
     
    			$cheminImage='oeil.png'; // les image doivent impérativement avoir le préfixe $key dans leur nom plus jpg
     
     
    		   $line = "<td ><input type=Image src=\"$cheminImage\" value='$text' name='action' id='$index' title='$title' "; // image transformé en bouton
                // applet-specific pre-Show handler
                if (strcasecmp($key, "Show") == 0) {
                    require "applet.js";
    				// Modif conseillé par E.Bzz
                     $handler = "document.getElementById(\"id\").click(); switchText(this.form,\"actionvalue\",\"$key\"); return appletPreShow()";
                } else {
     
                   $handler = "switchText(this.form,\"actionvalue\",\"$key\")";
     
     
                }
     
                $line .= "onclick='$handler'></td>\n";
     
               print $line ;
     
     
     
        print "<td><input type=hidden value='$level' name='option'></td>\n";
        if (isset($hidden)) {
            foreach ($hidden as $name => $value) {
                print "<input type=hidden value='$value' name='$name'>\n";
            }
        }

  5. #5
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Salut,
    Tu peux nous donner le HTML généré, c'est plus facile à lire.

  6. #6
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Citation Envoyé par andry.aime Voir le message
    Salut,
    Tu peux nous donner le HTML généré, c'est plus facile à lire.
    +1

    Surtout quand on lit pas le PHP

    Y a plus de checkbox ?

    A+

  7. #7
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    il est un peu long mais le même code se répète parce que l'id change
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    <script language="JavaScript" type="text/javascript">
    var last = "false";
    <!--        
    function checkAll(form, field, check, uncheck)
    {
    	var len = form.elements.length;
        if (last == "false") {
            ret = uncheck;
    	    for (var i = 0; i < len; i++) {
    	        if (form.elements[i].name == field+'[]')
    		        form.elements[i].checked = "true";
    	        if (form.elements[i].name == "checkUncheck")
    		        form.elements[i].value = ret;
            }
            last = "true";
        } else {
            ret = check;
    	    for (var i = 0; i < len; i++) {
    	        if (form.elements[i].name == field+'[]')
    		        form.elements[i].checked = "";
    	        if (form.elements[i].name == "checkUncheck")
    		        form.elements[i].value = ret;
    	    }
            last = "false";
    	}
        return ret;
    }
     
    function switchText(form, field, text)
    {
        var msg = "Field = " + field + " Text = " + text + "\n";
    	var len = form.elements.length;
    	for (var i = 0; i < len; i++) {
    	    if (form.elements[i].name == field) {
                form.elements[i].value = text;
            }
        }
    }
     
    //-->
    </script>
     
     
     
     
     
     
     
     
     
     
     
     
    <html><META HTTP-EQUIV=REFRESH CONTENT=60><head><title>MediPacs  - Studies Received Most Recently</title></head><body> 
     
     <LINK rel="stylesheet" type="text/css" href="template_style.css"><table width="100%" border="0" cellspacing="1" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="5"><tr style="background-color: #2A628E ;color: white; font-weight: bold"><td align="left" valign="middle" ><a href=''> <IMG src="logo3.jpg"  align='left' VALIGN='middle' BORDER='0' title='MEDIPACS'> </a>  <a href='home.php'> <IMG src="home.png"  align='left' VALIGN='middle' BORDER='0' title='Accueil'> </a>  <a href='search.php'> <IMG src="search.png"  align='left' VALIGN='middle' BORDER='0' title='Recherche'> </a> <a href='worklist.php'> <IMG src="worklist.png"  align='left' VALIGN='middle' BORDER='0' title='Liste de travail'> </a> <a href='status.php'> <IMG src="JobStatus.png"  align='left' VALIGN='middle' BORDER='0' title='Statut'> </a> <a href='user.php'> <IMG src="user.png"  align='left' VALIGN='middle' BORDER='0' title='Utilisateurs'> </a> <a href='config.php'> <IMG src="config.png"  align='left' VALIGN='middle' BORDER='0' title='Configuration'> </a> <b></b></td><td align='right'><a href='logout.php'><IMG src="disconect.png"  align='right' VALIGN='middle' BORDER='0' title='Déconnection'><br></td></tr></table></td></tr><tr><td> 
     
     
     
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr><td colspan=2><br><br></td></tr>
    <tr><td><br></td></tr>
    <tr><td align=left>
    Précédent Suivant</td><td align=right>
    Affichage des 1-10 examens sur 10 :</td></tr>
    </table><br>
    <form method='POST' action='actionItem.php'>
    <p><table width=20% border=0 cellspacing=0 cellpadding=5  align='center'>
    <tr>
    <input type='hidden' name='actionvalue'>
    <td align='left'><a href=''><IMG src="today.png"  name='today' title='Aujourdhui' BORDER='0' onclick="document.location.href='today.php'; return false;"></a></td><td align='left'><a href=''><IMG src="last7days.png" name='lastweek' title='Semaine Dernière' BORDER='0' onclick="document.location.href='lastWeek.php'; return false;"></a></td><td ><input type=Image src="Forward.jpg" value='Forward' name='action' title='Transmettre' onclick='switchText(this.form,"actionvalue","Forward")'></td>
    <td ><input type=Image src="Delete.jpg" value='Delete' name='action' title='Suppression' onclick='switchText(this.form,"actionvalue","Delete");return confirm("Are you sure?")'></td>
    <td ><input type=Image src="Export.jpg" value='Export' name='action' title='Exporter' onclick='switchText(this.form,"actionvalue","Export")'></td>
    <script language="JavaScript" type="text/javascript">
     
    <!--        
     
    // ----------------------------------------------------
     
    function appletPreShow()
    {
    	var bJavaWSInstalled = false;
    	var bIsWindows = false;
    	var bIsIE = false;
    	var bIsFF = false;
    	var bIsChrome = false;
    	var bIsOpera = false;
    	var bUnknownBrowser = false;
     
    	//alert('User Agent: ' + navigator.userAgent);
     
    	// Get the OS
    	if (navigator.userAgent.indexOf("Windows") != -1)
    	{
    		bIsWindows = true;
    	}
     
    	// Check if it is a known web browser
    	if (navigator.userAgent.indexOf("MSIE") != -1)
    	{
    		bIsIE = true;
    	}
    	else if (navigator.userAgent.indexOf("Firefox") != -1)
    	{
    		bIsFF = true;
    	}
    	else if (navigator.userAgent.indexOf("Chrome") != -1)
    	{
    		bIsChrome = true;
    	}
    	else if (navigator.userAgent.indexOf("Opera") != -1)
    	{
    		bIsOpera = true;
    	}
    	else
    	{
    		bUnknownBrowser = true;
    	}
     
    	// Determine if JWS is installed or not
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		x = navigator.mimeTypes['application/x-java-jnlp-file'];
    		if (x)
    		{
    			bJavaWSInstalled = true;
    		}
    	}
     
    	//alert('bIsWindows: ' + bIsWindows + ', bIsIE: ' + bIsIE + ', bIsFF: ' + bIsFF + ', bIsChrome: ' + bIsChrome + ', bIsOpera: ' + bIsOpera + ', bJavaWSInstalled: ' + bJavaWSInstalled);
     
    	// If we are on a known browser, having Java 5 or Java 6 installed
    	// also normally means we have Java Web Start installed, and vice-versa.
    	if ((bIsIE && (! isJavaWS5IE()) && (! isJavaWS6IE())) ||
    			(bIsFF && (! isJava5()) && (! isJava6())) ||
    			(bIsChrome && (! isJava5()) && (! isJava6())) ||
    			(bIsOpera && (! isJava5()) && (! isJava6()))
    			)
    	{
    		if (bIsWindows)
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download and install it now (Win32 version)?'))
    			{
    				alert('Please run the JRE installer once you have finished downloading it.\nYou may need to restart your web browser after the JRE installation finishes.');
    				self.location = "/RemotEye/JRE/jre-6u11-windows-i586-p.exe";
    			}
    		}
    		else
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    			{
    				self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    			}
    		}	
     
    		return false;
    	}
    	else if (bUnknownBrowser && (! bJavaWSInstalled))
    	{
    		if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    		{
    			self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    		}
     
    		return false;
    	}
     
    	return true;
    }
     
    function isJavaWS5IE()
    {
    	try
    	{
    		// Detect Java 5 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.5.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJavaWS6IE()
    {
    	try
    	{
    		// Detect Java 6 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.6.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJava5() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 5 platform
    			if (s == "application/x-java-applet;version=1.5")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
    function isJava6() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 6 platform
    			if (s == "application/x-java-applet;version=1.6")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
     
    //-->
     
    </script><td ><input type=Image src="Show.jpg" value='Show' name='action' title='Show images of checked studies' onclick='switchText(this.form,"actionvalue","Show"); return appletPreShow()'></td>
    <td ><input type=Image src="Download.jpg" value='Download' name='action' title='Télécharger' onclick='switchText(this.form,"actionvalue","Download")'></td>
    <td><input type=hidden value='study' name='option'></td>
    </tr>
    </table>
    <table width=100% border=0 cellpadding=5>
    <tr class=listhead bgcolor=#2A628E>
    <td class=survol><input type='checkbox' name='CheckTout[]' name='checkUncheck' onClick='checkAll(this.form,"entry", "Check All", "Uncheck All")'</td>
    <td class=survol></td>
    	<td class=survol><b><a class = maclasse href="home.php?sort=cmp_patientid&all=0">ID Patient</a></b></td>
    	<td class=survol><b><a class = maclasse href="home.php?sort=cmp_name&all=0">Nom Patient</b></td>
    	<td class=survol><b><a class=maclasse href=home.php?sort=cmp_date&all=0>Date</a></b></td>
     
    	<td class=survol><b><font color='white'>Heure<font></b></td>
    	<td class=survol><b><font color='white'>Radiologue<font></b></td>
    	<td class=survol><b><a class=maclasse href=home.php?sort=cmp_description&all=0>Description</a></b></td>
    	<td class=survol><b><font color='white'>Correspondant<font></b></td>
    	<td class=survol><b><FONT COLOR='white'>Nombre D'Images</FONT></b></td>
    </tr>
    0<tr class=donneesFond >
     
    	<td align=left width='1%' >
    		<input type='checkbox' name='entry[]' id='0' value='1.3.12.2.1107.5.8.3.485257.836649.80674856.2005121408291133'></td>
    	<td align=left width='4%'>
    <p><table width=20% border=0 cellspacing=0 cellpadding=5  align='center'>
    <tr>
    <input type='hidden' name='actionvalue'>
    <script language="JavaScript" type="text/javascript">
     
    <!--        
     
    // ----------------------------------------------------
     
    function appletPreShow()
    {
    	var bJavaWSInstalled = false;
    	var bIsWindows = false;
    	var bIsIE = false;
    	var bIsFF = false;
    	var bIsChrome = false;
    	var bIsOpera = false;
    	var bUnknownBrowser = false;
     
    	//alert('User Agent: ' + navigator.userAgent);
     
    	// Get the OS
    	if (navigator.userAgent.indexOf("Windows") != -1)
    	{
    		bIsWindows = true;
    	}
     
    	// Check if it is a known web browser
    	if (navigator.userAgent.indexOf("MSIE") != -1)
    	{
    		bIsIE = true;
    	}
    	else if (navigator.userAgent.indexOf("Firefox") != -1)
    	{
    		bIsFF = true;
    	}
    	else if (navigator.userAgent.indexOf("Chrome") != -1)
    	{
    		bIsChrome = true;
    	}
    	else if (navigator.userAgent.indexOf("Opera") != -1)
    	{
    		bIsOpera = true;
    	}
    	else
    	{
    		bUnknownBrowser = true;
    	}
     
    	// Determine if JWS is installed or not
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		x = navigator.mimeTypes['application/x-java-jnlp-file'];
    		if (x)
    		{
    			bJavaWSInstalled = true;
    		}
    	}
     
    	//alert('bIsWindows: ' + bIsWindows + ', bIsIE: ' + bIsIE + ', bIsFF: ' + bIsFF + ', bIsChrome: ' + bIsChrome + ', bIsOpera: ' + bIsOpera + ', bJavaWSInstalled: ' + bJavaWSInstalled);
     
    	// If we are on a known browser, having Java 5 or Java 6 installed
    	// also normally means we have Java Web Start installed, and vice-versa.
    	if ((bIsIE && (! isJavaWS5IE()) && (! isJavaWS6IE())) ||
    			(bIsFF && (! isJava5()) && (! isJava6())) ||
    			(bIsChrome && (! isJava5()) && (! isJava6())) ||
    			(bIsOpera && (! isJava5()) && (! isJava6()))
    			)
    	{
    		if (bIsWindows)
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download and install it now (Win32 version)?'))
    			{
    				alert('Please run the JRE installer once you have finished downloading it.\nYou may need to restart your web browser after the JRE installation finishes.');
    				self.location = "/RemotEye/JRE/jre-6u11-windows-i586-p.exe";
    			}
    		}
    		else
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    			{
    				self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    			}
    		}	
     
    		return false;
    	}
    	else if (bUnknownBrowser && (! bJavaWSInstalled))
    	{
    		if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    		{
    			self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    		}
     
    		return false;
    	}
     
    	return true;
    }
     
    function isJavaWS5IE()
    {
    	try
    	{
    		// Detect Java 5 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.5.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJavaWS6IE()
    {
    	try
    	{
    		// Detect Java 6 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.6.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJava5() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 5 platform
    			if (s == "application/x-java-applet;version=1.5")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
    function isJava6() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 6 platform
    			if (s == "application/x-java-applet;version=1.6")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }

  8. #8
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Pour cocher ou décocher, tu met l'attribut checked true ou false.
    Avec "true" ou "false", entre guillemets, c'est reconnue comme une chaine et non un booléen.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    <script language="JavaScript" type="text/javascript">
    var last = false;
    <!--        
    function checkAll(form, field, check, uncheck)
    {
    	var len = form.elements.length;
        if (last == false) {
            ret = uncheck;
    	    for (var i = 0; i < len; i++) {
    	        if (form.elements[i].name == field+'[]')
    		        form.elements[i].checked = true;
    	        if (form.elements[i].name == "checkUncheck")
    		        form.elements[i].value = ret;
            }
            last = true;
        } else {
            ret = check;
    	    for (var i = 0; i < len; i++) {
    	        if (form.elements[i].name == field+'[]')
    		        form.elements[i].checked = false;
    	        if (form.elements[i].name == "checkUncheck")
    		        form.elements[i].value = ret;
    	    }
            last = false;
    	}
        return ret;
    }
     
    function switchText(form, field, text)
    {
        var msg = "Field = " + field + " Text = " + text + "\n";
    	var len = form.elements.length;
    	for (var i = 0; i < len; i++) {
    	    if (form.elements[i].name == field) {
                form.elements[i].value = text;
            }
        }
    }
     
    //-->
    </script>

  9. #9
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Attention, des fonctions sont déclarées plusieurs fois ...

    A+

  10. #10
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    je crois que c'est beaucoup plus propre comme ça
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    //-->
    </script><td ><input type=Image src="oeil.png" value='Show' name='action' id='0' title='Show images of checked patients' onclick='document.getElementById("id").click(); switchText(this.form,"actionvalue","Show"); return appletPreShow()'></td>
    <td><input type=hidden value='study' name='option'></td>
    </tr>
    </table>
    </td>
    	<td><font face=arial size=2 color=#000000><a href='study.php?patientId=230472'>230472</a></font></td>
     
    	<td><font color=#18208F>Sandra Newman</font></td>
    	<td><font color=#18208F>2005-12-20</font></td>
    	<td><font color=#18208F>08:05:25</font></td>
    	<td><font color=#18208F>Ref^^^^</font></td>
    	<td><font face=arial size=2 color=#000000><a href='modifyStudy.php?uid=1.3.12.2.1107.5.8.3.485257.836649.80674856.2005121408291133&key=Description&column=description&value=SPINE'>SPINE</a></font></td>
    	<td><font color=#18208F>N/A</font></td>
     
    	<td><font color=#18208F>23</font></td>
    </tr>
    1<tr class=donneesFond >
    	<td align=left width='1%' >
    		<input type='checkbox' name='entry[]' id='1' value='1.3.12.2.1107.5.8.3.485257.836649.80675153.2005022109080132'></td>
    	<td align=left width='4%'>
    <p><table width=20% border=0 cellspacing=0 cellpadding=5  align='center'>
    <tr>
    <input type='hidden' name='actionvalue'>
    <script language="JavaScript" type="text/javascript">
     
    <!--        
     
    // ----------------------------------------------------
     
    function appletPreShow()
    {
    	var bJavaWSInstalled = false;
    	var bIsWindows = false;
    	var bIsIE = false;
    	var bIsFF = false;
    	var bIsChrome = false;
    	var bIsOpera = false;
    	var bUnknownBrowser = false;
     
    	//alert('User Agent: ' + navigator.userAgent);
     
    	// Get the OS
    	if (navigator.userAgent.indexOf("Windows") != -1)
    	{
    		bIsWindows = true;
    	}
     
    	// Check if it is a known web browser
    	if (navigator.userAgent.indexOf("MSIE") != -1)
    	{
    		bIsIE = true;
    	}
    	else if (navigator.userAgent.indexOf("Firefox") != -1)
    	{
    		bIsFF = true;
    	}
    	else if (navigator.userAgent.indexOf("Chrome") != -1)
    	{
    		bIsChrome = true;
    	}
    	else if (navigator.userAgent.indexOf("Opera") != -1)
    	{
    		bIsOpera = true;
    	}
    	else
    	{
    		bUnknownBrowser = true;
    	}
     
    	// Determine if JWS is installed or not
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		x = navigator.mimeTypes['application/x-java-jnlp-file'];
    		if (x)
    		{
    			bJavaWSInstalled = true;
    		}
    	}
     
    	//alert('bIsWindows: ' + bIsWindows + ', bIsIE: ' + bIsIE + ', bIsFF: ' + bIsFF + ', bIsChrome: ' + bIsChrome + ', bIsOpera: ' + bIsOpera + ', bJavaWSInstalled: ' + bJavaWSInstalled);
     
    	// If we are on a known browser, having Java 5 or Java 6 installed
    	// also normally means we have Java Web Start installed, and vice-versa.
    	if ((bIsIE && (! isJavaWS5IE()) && (! isJavaWS6IE())) ||
    			(bIsFF && (! isJava5()) && (! isJava6())) ||
    			(bIsChrome && (! isJava5()) && (! isJava6())) ||
    			(bIsOpera && (! isJava5()) && (! isJava6()))
    			)
    	{
    		if (bIsWindows)
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download and install it now (Win32 version)?'))
    			{
    				alert('Please run the JRE installer once you have finished downloading it.\nYou may need to restart your web browser after the JRE installation finishes.');
    				self.location = "/RemotEye/JRE/jre-6u11-windows-i586-p.exe";
    			}
    		}
    		else
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    			{
    				self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    			}
    		}	
     
    		return false;
    	}
    	else if (bUnknownBrowser && (! bJavaWSInstalled))
    	{
    		if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    		{
    			self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    		}
     
    		return false;
    	}
     
    	return true;
    }
     
    function isJavaWS5IE()
    {
    	try
    	{
    		// Detect Java 5 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.5.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJavaWS6IE()
    {
    	try
    	{
    		// Detect Java 6 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.6.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJava5() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 5 platform
    			if (s == "application/x-java-applet;version=1.5")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
    function isJava6() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 6 platform
    			if (s == "application/x-java-applet;version=1.6")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
     
    //-->
    </script><td ><input type=Image src="oeil.png" value='Show' name='action' id='1' title='Show images of checked patients' onclick='document.getElementById("id").click(); switchText(this.form,"actionvalue","Show"); return appletPreShow()'></td>
     
    <td><input type=hidden value='study' name='option'></td>
    </tr>
    </table>
    </td>
    	<td><font face=arial size=2 color=#000000><a href='study.php?patientId=00009'>00009</a></font></td>
    	<td><font color=#18208F> Proton, Osos</font></td>
    	<td><font color=#18208F>2005-02-21</font></td>
    	<td><font color=#18208F>16:24:00</font></td>
     
    	<td><font color=#18208F>43L^^^^</font></td>
    	<td><font face=arial size=2 color=#000000><a href='modifyStudy.php?uid=1.3.12.2.1107.5.8.3.485257.836649.80675153.2005022109080132&key=Description&column=description&value=Thorax'>Thorax</a></font></td>
    	<td><font color=#18208F>N/A</font></td>
    	<td><font color=#18208F>18</font></td>
    </tr>
    2<tr class=donneesFond >
    	<td align=left width='1%' >
     
    		<input type='checkbox' name='entry[]' id='2' value='1.2.826.0.1.3680043.2.455.30.11.1271002.8.242615'></td>
    	<td align=left width='4%'>
    <p><table width=20% border=0 cellspacing=0 cellpadding=5  align='center'>
    <tr>
    <input type='hidden' name='actionvalue'>
    <script language="JavaScript" type="text/javascript">
     
    <!--        
     
    // ----------------------------------------------------
     
    function appletPreShow()
    {
    	var bJavaWSInstalled = false;
    	var bIsWindows = false;
    	var bIsIE = false;
    	var bIsFF = false;
    	var bIsChrome = false;
    	var bIsOpera = false;
    	var bUnknownBrowser = false;
     
    	//alert('User Agent: ' + navigator.userAgent);
     
    	// Get the OS
    	if (navigator.userAgent.indexOf("Windows") != -1)
    	{
    		bIsWindows = true;
    	}
     
    	// Check if it is a known web browser
    	if (navigator.userAgent.indexOf("MSIE") != -1)
    	{
    		bIsIE = true;
    	}
    	else if (navigator.userAgent.indexOf("Firefox") != -1)
    	{
    		bIsFF = true;
    	}
    	else if (navigator.userAgent.indexOf("Chrome") != -1)
    	{
    		bIsChrome = true;
    	}
    	else if (navigator.userAgent.indexOf("Opera") != -1)
    	{
    		bIsOpera = true;
    	}
    	else
    	{
    		bUnknownBrowser = true;
    	}
     
    	// Determine if JWS is installed or not
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		x = navigator.mimeTypes['application/x-java-jnlp-file'];
    		if (x)
    		{
    			bJavaWSInstalled = true;
    		}
    	}
     
    	//alert('bIsWindows: ' + bIsWindows + ', bIsIE: ' + bIsIE + ', bIsFF: ' + bIsFF + ', bIsChrome: ' + bIsChrome + ', bIsOpera: ' + bIsOpera + ', bJavaWSInstalled: ' + bJavaWSInstalled);
     
    	// If we are on a known browser, having Java 5 or Java 6 installed
    	// also normally means we have Java Web Start installed, and vice-versa.
    	if ((bIsIE && (! isJavaWS5IE()) && (! isJavaWS6IE())) ||
    			(bIsFF && (! isJava5()) && (! isJava6())) ||
    			(bIsChrome && (! isJava5()) && (! isJava6())) ||
    			(bIsOpera && (! isJava5()) && (! isJava6()))
    			)
    	{
    		if (bIsWindows)
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download and install it now (Win32 version)?'))
    			{
    				alert('Please run the JRE installer once you have finished downloading it.\nYou may need to restart your web browser after the JRE installation finishes.');
    				self.location = "/RemotEye/JRE/jre-6u11-windows-i586-p.exe";
    			}
    		}
    		else
    		{
    			if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    			{
    				self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    			}
    		}	
     
    		return false;
    	}
    	else if (bUnknownBrowser && (! bJavaWSInstalled))
    	{
    		if (confirm('An appropriate version of the Java Runtime Environment is not installed.\nWould you like to download it now from Sun website?'))
    		{
    			self.location = "http://java.sun.com/PluginBrowserCheck?fail=http://java.sun.com/javase/downloads/index.jsp";
    		}
     
    		return false;
    	}
     
    	return true;
    }
     
    function isJavaWS5IE()
    {
    	try
    	{
    		// Detect Java 5 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.5.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJavaWS6IE()
    {
    	try
    	{
    		// Detect Java 6 platform
    		var obj = new ActiveXObject("JavaWebStart.isInstalled.1.6.0.0");
    		if (obj != null)
    		{
    			return true;
    		}
    	} 
    	catch (exception) 
    	{
    		return false;
    	}
     
    	return false;
    }
     
    function isJava5() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 5 platform
    			if (s == "application/x-java-applet;version=1.5")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
    function isJava6() 
    {
    	if (navigator.mimeTypes && navigator.mimeTypes.length)
    	{
    		for (var i = 0; i < navigator.mimeTypes.length; ++i) 
    		{
    			s = navigator.mimeTypes[i].type;
    			//alert(s);
     
    			// Detect Java 6 platform
    			if (s == "application/x-java-applet;version=1.6")
    			{
    				return 1;
    			}
    		}
    	}
     
    	return 0;
    }
     
     
    //-->
    </script><td ><input type=Image src="oeil.png" value='Show' name='action' id='2' title='Show images of checked patients' onclick='document.getElementById("id").click(); switchText(this.form,"actionvalue","Show"); return appletPreShow()'></td>
    <td><input type=hidden value='study' name='option'></td>
    </tr>
    </table>
    </td>
    	<td><font face=arial size=2 color=#000000><a href='study.php?patientId=151890'>151890</a></font></td>
    	<td><font color=#18208F>Jose PEREIRA GONCALVES</font></td>
     
    	<td><font color=#18208F>2009-06-17</font></td>
    	<td><font color=#18208F>08:37:05</font></td>
    	<td><font color=#18208F>PICARD^Didier^^^</font></td>
    	<td><font face=arial size=2 color=#000000><a href='modifyStudy.php?uid=1.2.826.0.1.3680043.2.455.30.11.1271002.8.242615&key=Description&column=description&value=Abdomen'>Abdomen</a></font></td>
    	<td><font color=#18208F>N/A</font></td>
    	<td><font color=#18208F>12</font></td>
     
    </tr>
    3<tr class=donneesFond >
    	<td align=left width='1%' >
    		<input type='checkbox' name='entry[]' id='3' value='1.2.826.0.1.3680043.2.455.30.11.1271002.8.240311'></td>
    	<td align=left width='4%'>
    <p><table width=20% border=0 cellspacing=0 cellpadding=5  align='center'>
    <tr>
    <input type='hidden' name='actionvalue'>
    <script language="JavaScript" type="text/javascript">
     
    <!--
    puisque ça montre bien l'évolution de l'id de la checkbox et de chaque oeil

  11. #11
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    le fait de le mettre true ou false en tant que chaine est-ce que ça pose problème? puisque ça marche bien quand je clic sur ma checkbox ensuite sur l'oeil

  12. #12
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Ce qui pose problème est de déclarer plusieurs fois tes fonctions (ex : appletPreShow() )

    A+

  13. #13
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Points : 15 059
    Points
    15 059
    Par défaut
    Tu a aussi plusieurs noms pour un élément
    <input type='checkbox' name='CheckTout[]' name='checkUncheck'

  14. #14
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    En me débrouillant j'ai fini par trouvé comment faire pour activer la checkbox en cliquant sur l'oeil. il suffisait de rajouter ça dans le code que j'ai donné dès le début de la discussion
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $handler ="document.getElementById($index).checked=\"true\";switchText(this.form,\"actionvalue\",\"$key\"); return appletPreShow();";

  15. #15
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    et comment tu fais pour décocher ?

    A+

  16. #16
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Ceci dit, on t'a signalé pas mal d'erreurs.
    Si tu ne les corriges pas, tu auras toujours des problèmes (même si tu arrives à les contourner cette fois-ci)

    A+

  17. #17
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    En fait j'ai une fonction js (unCheckAll) qui décoche d'abord toutes les cases qui auraient été cochées avant, ce qui fait que la ligne de code donne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $handler ="unCheckAll(this.form,\"entry\", \"$check\", \"$uncheck\");document.getElementById($index).checked=\"true\";switchText(this.form,\"actionvalue\",\"$key\"); return appletPreShow();";
    voici le code de la fonction js elle est un peu bidouillée mais elle marche
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    function unCheckAll(form, field, check, uncheck)
    {
    	var len = form.elements.length;
        if (last == "false") {
            ret = uncheck;
    	    for (var i = 0; i < len; i++) {
    	        if (form.elements[i].name == field+'[]')
    		        form.elements[i].checked = "";
    	        if (form.elements[i].name == "checkUncheck")
    		        form.elements[i].value = ret;
            }
            last = "true";
        } else {
            ret = check;
    	    for (var i = 0; i < len; i++) {
    	        if (form.elements[i].name == field+'[]')
    		        form.elements[i].checked = "";
    	        if (form.elements[i].name == "checkUncheck")
    		        form.elements[i].value = ret;
    	    }
            last = "false";
    	}
        return ret;
    }

  18. #18
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Citation Envoyé par E.Bzz Voir le message
    Ce qui pose problème est de déclarer plusieurs fois tes fonctions (ex : appletPreShow() )
    A moins que ton code ait changé ...

    A+

  19. #19
    Membre habitué
    Inscrit en
    Avril 2007
    Messages
    521
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 521
    Points : 167
    Points
    167
    Par défaut
    mon code n'a pas changé mais je vais essayer de l'optimiser en ne déclarant qu'une fois cette fameuse fonction

  20. #20
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Citation Envoyé par sebac Voir le message
    je vais essayer de l'optimiser en ne déclarant qu'une fois cette fameuse fonction
    Que les choses soient claires : ce n'est pas une optimisation, mais une correction

    Déclarer une même fonction plusieurs fois est une erreur ...

    A+

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Réponses: 11
    Dernier message: 20/09/2007, 14h51
  2. Réponses: 2
    Dernier message: 14/09/2006, 14h24
  3. Comment détecté automatiquement Une base erronée.
    Par ada_b dans le forum Débuter
    Réponses: 4
    Dernier message: 13/01/2005, 07h56
  4. [Internet] Comment lancer automatiquement la connexion ?
    Par laayouni_mus dans le forum Web & réseau
    Réponses: 4
    Dernier message: 10/09/2004, 20h14
  5. [JDevelopper] Comment indenter automatiquement le code ??
    Par Bicnic dans le forum JDeveloper
    Réponses: 5
    Dernier message: 03/08/2004, 21h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo