Formular: Inputfield with UP/Down-Control element

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bobel

    #1

    Formular: Inputfield with UP/Down-Control element

    Hi,

    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.

    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)

    thanxs

    Martin Stanka
  • Lasse Reichstein Nielsen

    #2
    Re: Formular: Inputfield with UP/Down-Control element

    Martin.stanka@l euze.de (Bobel) writes:
    [color=blue]
    > 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.[/color]

    <form ...>
    <input type="text" name="number">
    <input type="button" value="+"
    onclick="this.f orm.elements['number'].value++">
    <input type="button" value="-"
    onclick="this.f orm.elements['number'].value--">
    </form>
    [color=blue]
    > 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)[/color]

    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 - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Formular: Inputfield with UP/Down-Control element

      Lasse Reichstein Nielsen wrote:
      [color=blue]
      > The initial values of the input elements can be written as part of the
      > input tag: <input type="text" value"my initial value">[/color]

      <input value="my initial value">

      For the typo and for `text' is the default value.


      PointedEars

      Comment

      • Bobel

        #4
        Re: Formular: Inputfield with UP/Down-Control element

        Hi,

        Lasse Reichstein Nielsen <lrn@hotpop.com > wrote in message news:<he0bgguh. fsf@hotpop.com> ...[color=blue][color=green]
        > > 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)[/color]
        >
        > 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.[/color]

        yes, i knew this, but I am processing my HTML-page, before sending to
        the client, through a C-Programm, and, one thing i do, is replace a
        tag, with the value of my text-box with the real number, if i could do
        this, at the beginning of the programm trough javascript, i am able to
        save time. (before you recomment it, the webserver is a small uC, so i
        have no access to PHP or standart CGI-functions)
        [color=blue]
        > 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[/color]

        that shouldn`t be the problem, because at the moment, i only serve my
        pages in a local net.

        Thanx for your help

        Martin

        Comment

        Working...