inputbox

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

    inputbox

    Hi.

    How to change the text of inputbox if i have already set the style for
    something else?

    In other words:
    <input name="fItem" type="text" id="fItem" style="border:h idden" size="80"
    maxlength="60" border="0" />

    I can not add two styles on the same inputbox so i guess that javascript is
    the only solution?
    If so, then how ?


    Regards!


  • GArlington

    #2
    Re: inputbox

    On Sep 23, 11:27 am, "Intos" <in...@mail.com wrote:
    Hi.
    >
    How to change the text of inputbox if i have already set the style for
    something else?
    >
    In other words:
    <input name="fItem" type="text" id="fItem" style="border:h idden" size="80"
    maxlength="60"  border="0" />
    >
    I can not add two styles on the same inputbox so i guess that javascript is
    the only solution?
    If so, then how ?
    >
    Regards!
    <input ... style="border:h idden; color:blind; some:other;" ... />
    Is that what you wanted?

    Comment

    • Erwin Moller

      #3
      Re: inputbox


      Intos schreef:
      Hi.
      >
      How to change the text of inputbox if i have already set the style for
      something else?
      >
      In other words:
      <input name="fItem" type="text" id="fItem" style="border:h idden" size="80"
      maxlength="60" border="0" />
      >
      I can not add two styles on the same inputbox so i guess that javascript is
      the only solution?
      If so, then how ?
      Hi,

      In your case:
      document.getEle mentById("fItem ").style.border ='1px solid #99999;';

      Of course you can assign anything valid to the style.

      Regards,
      Erwin Moller

      >
      >
      Regards!
      >
      >

      --
      =============== =============
      Erwin Moller
      Now dropping all postings from googlegroups.
      Why? http://improve-usenet.org/
      =============== =============

      Comment

      • Intos

        #4
        Re: inputbox

        "Erwin Moller"
        <Since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote in
        message news:48d8d477$0 $186$e4fe514c@n ews.xs4all.nl.. .
        >
        Intos schreef:
        >Hi.
        >>
        >How to change the text of inputbox if i have already set the style for
        >something else?
        >>
        >In other words:
        ><input name="fItem" type="text" id="fItem" style="border:h idden"
        >size="80" maxlength="60" border="0" />
        >>
        >I can not add two styles on the same inputbox so i guess that javascript
        >is the only solution?
        >If so, then how ?
        >
        Hi,
        >
        In your case:
        document.getEle mentById("fItem ").style.border ='1px solid #99999;';
        >
        Of course you can assign anything valid to the style.
        >
        Regards,
        Erwin Moller
        >
        >
        >>
        >>
        >Regards!
        >
        >
        --
        =============== =============
        Erwin Moller
        Now dropping all postings from googlegroups.
        Why? http://improve-usenet.org/
        =============== =============
        ----------------
        Thank you guys, that's it. Just one small thing. How to align the text of
        the input box in the center of the inputbox ?


        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: inputbox

          GArlington wrote:
          On Sep 23, 11:27 am, "Intos" <in...@mail.com wrote:
          >How to change the text of inputbox if i have already set the style for
          >something else?
          >>
          >In other words:
          ><input name="fItem" type="text" id="fItem" style="border:h idden" size="80"
          >maxlength="6 0" border="0" />
          >>
          >I can not add two styles on the same inputbox so i guess that javascript is
          >the only solution?
          >If so, then how ?
          >
          <input ... style="border:h idden; color:blind; some:other;" ... />
          Is that what you wanted?
          Unlikely, since it is not Valid HTML or CSS in the first place.

          <http://validator.w3.or g/>
          <http://jigsaw.w3.org/css-validator/>


          PointedEars
          --
          Anyone who slaps a 'this page is best viewed with Browser X' label on
          a Web page appears to be yearning for the bad old days, before the Web,
          when you had very little chance of reading a document written on another
          computer, another word processor, or another network. -- Tim Berners-Lee

          Comment

          • SAM

            #6
            Re: inputbox

            Intos a écrit :
            Hi.
            >
            How to change the text of inputbox if i have already set the style for
            something else?
            document.forms[0].elements['myInput'].value = 'some text';
            In other words:
            <input name="fItem" type="text" id="fItem" style="border:h idden" size="80"
            maxlength="60" border="0" />
            >
            I can not add two styles on the same inputbox so i guess that javascript is
            the only solution?
            certainly not
            If so, then how ?
            Perhaps would you have to learn a bit about CSS ?

            In JS :

            var d = document.forms[0].elements['myInput'].style:
            d.color = 'blue';
            d.fontWeight = 'bold';
            d.textDecoratio n = 'underline';
            d.textAlign = 'center';
            etc ... etc ...


            try :

            <html>
            <style type="text/css">
            ..red { color: red }
            ..blu { color: blue }
            ..bold { font-weeight: bold; }
            input { color: inherit; border: 3px solid green }
            </style>

            <form action="#" onsubmit="retur n false">
            <p class="red" id="one">
            <input value="test 1">
            <input value="test 2 (blue n' bold by class)" class="blu bold">
            <input value="test 1">
            </p>
            <p class="blu" id="two">
            <input value="test 4">
            <input value="test 5 (red n' bold by style)"
            style="color:re d;font-weight:bold"">
            <input value="test 6">
            </p>
            <p><button onclick="var d =document.getEl ementById('one' );
            d.className = d.className=='r ed'? 'blu' : 'red';">toggle 1</button>
            <button onclick="var d =document.getEl ementById('two' );
            d.className = d.className=='r ed'? 'blu' : 'red';">toggle 2</button>
            </form>
            </html>

            --
            sm

            Comment

            • Tom Cole

              #7
              Re: inputbox

              On Sep 23, 8:41 am, "Intos" <in...@mail.com wrote:
              "Erwin Moller"
              <Since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote in
              messagenews:48d 8d477$0$186$e4f e514c@news.xs4a ll.nl...
              >
              >
              >
              >
              >
              >
              >
              Intos schreef:
              Hi.
              >
              How to change the text of inputbox if i have already set the style for
              something else?
              >
              In other words:
              <input name="fItem" type="text" id="fItem" style="border:h idden"
              size="80" maxlength="60"  border="0" />
              >
              I can not add two styles on the same inputbox so i guess that javascript
              is the only solution?
              If so, then how ?
              >
              Hi,
              >
              In your case:
              document.getEle mentById("fItem ").style.border ='1px solid #99999;';
              >
              Of course you can assign anything valid to the style.
              >
              Regards,
              Erwin Moller
              >
              Regards!
              >
              --
              =============== =============
              Erwin Moller
              Now dropping all postings from googlegroups.
              Why?http://improve-usenet.org/
              =============== =============
              >
              ----------------
              Thank you guys, that's it. Just one small thing. How to align  the textof
              the input box in the center of the inputbox ?- Hide quoted text -
              >
              - Show quoted text -
              document.getEle mentById("fItem ").style.textAl ign="center"

              Comment

              • Hal Rosser

                #8
                Re: inputbox


                "Intos" <intos@mail.com wrote in message
                news:gbagas$bh5 $1@localhost.lo caldomain...
                Hi.
                >
                How to change the text of inputbox if i have already set the style for
                something else?
                >
                In other words:
                <input name="fItem" type="text" id="fItem" style="border:h idden" size="80"
                maxlength="60" border="0" />
                >
                I can not add two styles on the same inputbox so i guess that javascript
                is the only solution?
                If so, then how ?
                >
                Naw - just use the value attribute
                <input name="fItem" type="text" id="fItem"
                style="border:h idden" size="80"
                maxlength="60" border="0"
                value="Hello world" />

                And if you need more styles, separate them with semicolons.

                ..


                Comment

                Working...