Notice: Undefined variable: onload in /home/sites/site42004/web/inc/HTMLkopB.inc.php on line 5
>
U bent hier » http://www.goudappel.org/ OOOR/ simpelcalc.php
Proof of concept
Array of textvalues in a spin button

De code:

<script type = 'text/javascript'> cars = new Array('Opel','Saab','Volvo','BMW'); function up(car) { index = cars.indexOf(carform.car.value); if(index < (cars.length - 1)){index = index +1;}else{index = 0;} document.carform.car.value = cars[index]; } function down(car) { index = cars.indexOf(carform.car.value); if(index > 0){index = index - 1;}else{index = cars.length - 1;} document.carform.car.value = cars[index]; } </script> <form name = 'carform'> <table cellpadding = '0' cellspacing = '0' border = '0'> <tr> <td rowspan = '2'><input type = 'text' name = 'car' value = 'Opel' style = 'width:50px; height:23px; font-weight:bold;' /></td> <td><input type = 'button' value = ' &#9650; ' onclick = 'up();' style = 'font-size:7px; margin:0; padding:0; width:20px; height:12px;' /></td> </tr> <tr> <td><input type = button value = ' &#9660; ' onclick = 'down();' style = 'font-size:7px; margin:0; padding:0; width:20px; height:12px;' /></td> </tr> </table> <input type = 'submit' value = 'Submit' /> </form>