TAB volgorde moet anders.

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Paco de Wulp

Paco de Wulp

05/09/2013 13:10:38
Quote Anchor link
Ik wil de TAB zo hebben, dat nadat Auto1 is ingevuld er wordt doorgegaan met Auto2 en niet naar Auto11 wordt gesprongen.
Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="language" content="NL">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8 ">
<title>Autoparade Maximaal 25 auto's te beoordelen</title>
</head>
<body>
<center>
    <?php    
    $aantal
= 23;
    echo "Aantal auto's = <b>".$aantal."</b><br><br>";
    echo "<table>";
    
    switch (true)
    {     case (
$aantal <=10) :
            echo "<tr><td>Auto</td><td>&nbsp</td><td>Beoordeling</td></tr>";
            for ( $i=0; $i < 10; $i++)
            {
    $v1 = $i + 1; $s1 = $i;
                if ($v1 <= $aantal)
                {
    echo "<td><b>".$v1."</b></td><td>--></td><td><b><input type='number' size=2 maxlength=2 name='subvragen[]' value=".$beoordeling[$s1]." ></b></td><td></td></tr>";}
                else
                {    echo "<td colspan=3>&nbsp</td></tr>";}    
            }

            break;
        case (
$aantal <=20) :
            echo "<tr><td>Auto</td><td>&nbsp</td><td>Beoordeling</td><td>&nbsp&nbsp&nbsp&nbsp&nbsp</td><td>Auto</td><td>&nbsp</td><td>Beoordeling</td></tr>";                                
            for ( $i=0; $i < 10; $i++)
             {
    $v1 = $i + 1; $v2 = $i + 11;     
                 $s1 = $i;          $s2 = $i + 10;    
                 echo "<td><b>".$v1."</b></td><td>--></td><td><b><input type='number' size=2 maxlength=2 name='subvragen[]' value=".$beoordeling[$s1]." ></b></td><td></td>";
                 if ($v2 <= $aantal)
                 {
    echo "<td><b>".$v2."</b></td><td>--></td><td><b><input type='number' size=2 maxlength=2 name='subvragen[]' value=".$beoordeling[$s2]." ></b></td></tr>";}
                 else
                 {    echo "<td colspan=3>&nbsp</td></tr>";}                    
             }

             break;
        case (
$aantal <=30) :
            echo "<tr><td>Auto</td><td>&nbsp</td><td>Beoordeling</td><td>&nbsp&nbsp&nbsp&nbsp&nbsp</td><td>Auto</td><td>&nbsp</td><td>Beoordeling</td><td>&nbsp&nbsp&nbsp&nbsp&nbsp</td><td>Auto</td><td>&nbsp</td><td>Beoordeling</td></tr>";                
            for ( $i=0; $i < 10; $i++)
             {
    $v1 = $i + 1; $v2 = $i + 11;         $v3 = $i + 21;
                 $s1 = $i;          $s2 = $i + 10;             $s3 = $i + 20;
                 echo "<td><b>".$v1."</b></td><td>--></td><td><b><input type='number' size=2 maxlength=2 name='subvragen[]' value=".$beoordeling[$s1]." ></b></td><td></td>";
                 echo "<td><b>".$v2."</b></td><td>--></td><td><b><input type='number' size=2 maxlength=2 name='subvragen[]' value=".$beoordeling[$s2]." ></b></td><td></td>";
                 if ($v3 <= $aantal)
                 {
    echo "<td><b>".$v3."</b></td><td>--></td><td><b><input type='number' size=2 maxlength=2 name='subvragen[]' value=".$beoordeling[$s3]." ></b></td></tr>";}
                 else
                 {    echo "<td colspan=3>&nbsp</td></tr>";}
             }

             break;             
     }

     echo "</table>";
    ?>

</center>    

</body>
</html>


Hoe doe ik dat ?
Gewijzigd op 05/09/2013 13:11:16 door Paco de Wulp
 
PHP hulp

PHP hulp

24/04/2024 22:11:25
 
- Ariën  -
Beheerder

- Ariën -

05/09/2013 13:22:48
Quote Anchor link
HTML kent ook een tabindex-attribuut voor formulier-elementen. Hiermee kan je de volgorde van de velden bepalen waarop gefocusd wordt d.m.v. de TAB-toets,

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<input type='text' name='auto1' tabindex="1">
<input type='text' name='auto2' tabindex="3">
<input type='text' name='auto3' tabindex="5">
<input type='text' name='auto4' tabindex="4">
<input type='text' name='auto5' tabindex="2">
 
Paco de Wulp

Paco de Wulp

05/09/2013 14:00:47
Quote Anchor link
Bedankt Aar, het werkt !
 
- Ariën  -
Beheerder

- Ariën -

05/09/2013 14:05:06
Quote Anchor link
Graag gedaan :-)
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.