Ma***********@leuze.de (Bobel) writes:
I am searching for an Input box, where I am able as one possibility to
enter a number, and as an second possible action, click one of two
small buttons on the side to increase/decrease the number in the box.
<form ...>
<input type="text" name="number">
<input type="button" value="+"
onclick="this.form.elements['number'].value++">
<input type="button" value="-"
onclick="this.form.elements['number'].value--">
</form>
a second small question, is it possible, to declare all the values, of
input boxes at the beginning of my HTML-document? (I mean values, that
are entered, at loading of the page)
The initial values of the input elements can be written as part of the
input tag: <input type="text" value"my initial value">
It is by far the safets way to do it.
You can use Javascript to enter the values later, but you have to wait
for the form controls to be loaded, and then the user might start filling
in the first ones before the later ones have loaded, and setting the
value later will overwrite the user's entry. It's dangerous, and I would
recommend against it.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'