changing styles of createElement | appendChild

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

    changing styles of createElement | appendChild

    hi,

    when i use appendChild, the following code ends in success

    cellSec3=docume nt.createElemen t('TD');

    aTextBox=docume nt.createElemen t('input');
    aTextBox.type = 'text';
    aTextBox.value = nz(s_unit_price );
    aTextBox.size = '15';
    aTextBox.name = 'txt_box'
    aTextBox.onchan ge=onChangeEven t();

    cellSec3.append Child(aTextBox) ;

    however, i would like to learn about the other attributes i can assign
    to "aTextBox". does anyone know of any link to get me started?

    As an example, I wish to change the alignment of the text inside my
    text box, i have tried:

    aTextBox.text-align = 'right';
    aTextBox.style. text-align = 'right';
    aTextBox.style. align = 'right';

    among others, during searching i came across the term:

    aTextBox.style. key = 1;

    which does not seem to do anything, but causes no error, i'dg gratly
    appreciate any help;

    regards, kie
  • DU

    #2
    Re: changing styles of createElement | appendChild

    kie wrote:
    [color=blue]
    > hi,
    >
    > when i use appendChild, the following code ends in success
    >
    > cellSec3=docume nt.createElemen t('TD');
    >
    > aTextBox=docume nt.createElemen t('input');
    > aTextBox.type = 'text';
    > aTextBox.value = nz(s_unit_price );
    > aTextBox.size = '15';
    > aTextBox.name = 'txt_box'
    > aTextBox.onchan ge=onChangeEven t();[/color]

    I'm pretty sure this last instruction won't work.
    aTextBox.onchan ge = new Function ("evt", function body);
    [color=blue]
    >
    > cellSec3.append Child(aTextBox) ;
    >
    > however, i would like to learn about the other attributes i can assign
    > to "aTextBox". does anyone know of any link to get me started?
    >
    > As an example, I wish to change the alignment of the text inside my
    > text box, i have tried:
    >
    > aTextBox.text-align = 'right';
    > aTextBox.style. text-align = 'right';
    > aTextBox.style. align = 'right';
    >[/color]

    aTextBox.style. textAlign = "right";

    [color=blue]
    > among others, during searching i came across the term:
    >
    > aTextBox.style. key = 1;
    >[/color]

    Invalid.
    [color=blue]
    > which does not seem to do anything, but causes no error, i'dg gratly
    > appreciate any help;
    >
    > regards, kie[/color]


    DU
    --
    Javascript and Browser bugs:

    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


    Comment

    • Vjekoslav Begovic

      #3
      Re: changing styles of createElement | appendChild

      "kie" <kiedrea@yahoo. com> wrote in message
      news:5849b244.0 309170301.b1259 b9@posting.goog le.com...[color=blue]
      > hi,
      >
      > when i use appendChild, the following code ends in success
      >
      > cellSec3=docume nt.createElemen t('TD');
      >
      > aTextBox=docume nt.createElemen t('input');
      > aTextBox.type = 'text';
      > aTextBox.value = nz(s_unit_price );
      > aTextBox.size = '15';
      > aTextBox.name = 'txt_box'
      > aTextBox.onchan ge=onChangeEven t();
      >
      > cellSec3.append Child(aTextBox) ;
      >
      > however, i would like to learn about the other attributes i can assign
      > to "aTextBox". does anyone know of any link to get me started?[/color]

      You can see which attributes your browser supports running this code:

      var str="";
      for (var i in aTextBox)
      str = str + i + ",\n";
      document.write( str);


      Comment

      Working...