Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to deside font type, size and color in a "inputbox"?

    I have a javascript that produce some text in a input box. But the text has default fonttype, size and color. How do I deside my own size and type?...

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,239
    Thanks
    203
    Thanked 2,554 Times in 2,532 Posts
    Here's an example:-

    <p align="center"><center><font face="Arial" size="3" color="#FF0000"><em><b>Additional Comments or Remarks</b></em><br><textarea name = "Remarks" cols = "54" rows = "2" wrap="virtual" style = "background:#FFFFFF; font-family: 'Arial' font-size:'11pt'; font-weight:'700'; " onfocus = "this.style.background = '#99FF99'" onblur = "this.style.background = '#FFFFFF'"></textarea></font></center></p>

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Location
    USA
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah... depreciated tags, JS, quoted styles, other stuff...

  • #4
    New Coder
    Join Date
    Dec 2003
    Location
    Soraga, Trentino, Italy
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is something like this deprecated?


    object.style.backgroundColor='#ffffcc';
    object.style.fontSize='1em';
    object.style.fontFamily='something'


    !?!

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,239
    Thanks
    203
    Thanked 2,554 Times in 2,532 Posts
    Originally posted by Paul Jr
    Yeah... deprec(i)ated tags, JS, quoted styles, other stuff...
    Ah, yes, but it works!

    "Deprecated" tags etc. will be around for a long, long time yet.
    There are far too many web pages already in existence.
    But suggestions for changing it into css will be very welcome.

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Philip M
    Ah, yes, but it works!

    "Deprecated" tags etc. will be around for a long, long time yet.
    There are far too many web pages already in existence.
    But suggestions for changing it into css will be very welcome.
    Try something like this:
    Code:
    <style type="text/css">
    textarea{
    background-image:url(blue_saturn.jpg);
    background:#000000;
    color:#0000FF;
    font-family:Arial;
    font-weight:700;
    font-size:11pt;
    }
    </style>
    </HEAD>
    
    <BODY>
    <form>
    <textarea cols="44" rows="12"></textarea>
    </form>
    Or using classes:
    Code:
    <style type="text/css">
    textarea.customT{
    background-image:url(blue_saturn.jpg);
    background:#000000;
    color:#0000FF;
    font-family:Arial;
    font-weight:700;
    font-size:11pt;
    }
    </style>
    </HEAD>
    
    <BODY>
    <form>
    <textarea class="customT" cols="44" rows="12"></textarea><br>
    <textarea cols="44" rows="12"></textarea>
    </form>
    .....Willy

    Edit: Added working example(s).
    Last edited by Willy Duitt; 12-29-2003 at 02:58 PM.

  • #7
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Philip M
    Ah, yes, but it works!

    "Deprecated" tags etc. will be around for a long, long time yet.
    There are far too many web pages already in existence.
    But suggestions for changing it into css will be very welcome.
    Yes, but they'll be around for even longer if people keep using them! <font> tags + text only browsers, or other alternative user agents = .
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #8
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,239
    Thanks
    203
    Thanked 2,554 Times in 2,532 Posts
    Someone pointed out to me that the quality of the carpentry I normally achieve in manufacturing garden nesting boxes is of no interest whatsoever to the birds. It is valued and admired only by the creator of the nesting boxes, not the user. Any rough old thing will be entirely satisfactory for them.

    The same applies to web pages. 99.9% of users do not care
    a jot whether the page uses <font>, css style sheets, classes or whatever. They care only that it works.

    Of course, it is always better to use the most correct and up-to-date methods in new work, as opposed to modifying the old.

    May 2004 bring peace and prosperity to all. Or, as the Scots might say, "Lang mae ye auld sporran reek o' porridge!"

  • #9
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The same applies to web pages. 99.9% of users do not care
    a jot whether the page uses <font>, css style sheets, classes or whatever. They care only that it works.
    1. That means you'll be alienating 0.1% of users for no reason.
    2. Superfluous markup results in bigger file sizes, therefore bigger bandwidth and therefore bigger costs eventually.
    3. The fact of the matter is that depreciated tags will eventually drop out of usage. Future-proof your code by coding with the new standards.
    4. Seperating the style and content means you can code in XML, which in turn means better interoperabillity, semantic code, and less ambiguity through stricter type.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #10
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Philip M
    Someone pointed out to me that the quality
    of the carpentry I normally achieve in manufacturing garden
    nesting boxes is of no interest whatsoever to the birds. It is
    valued and admired only by the creator of the nesting boxes, not
    the user. Any rough old thing will be entirely satisfactory for
    them.
    No offense intended Philip

    But could that someone have been a person whom
    justified his shoddy work with that lame arguement?

    It may be true the birds don't give a hoot
    But a well constructed nesting box will sell much quicker
    and demand a higher price than Any rough old thing....

    .....Willy

    BTW: Did the styles work for you?

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your analogy is not particularly accurate - the birds do care - they care when they get wood splinters in their feathers and hurt their feet on the rough edges.

    In any case it isn't 99.9% - 0.1%. It's more like 80/20.
    Last edited by brothercake; 12-30-2003 at 01:29 AM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #12
    Regular Coder
    Join Date
    Dec 2003
    Location
    USA
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Heheh, sorry for the bad vibes, people. I took to CSS right quick and I can never see how anyone would even use anything different -- I tend to get emotional. .

    Also, I didn't see the need for the JS, unless hvadseth79 wanted the background color to change when the text box is selected. I didn't catch if he wanted that or not from his post.

  • #13
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by Paul Jr
    Also, I didn't see the need for the JS, unless hvadseth79 wanted the background color to change when the text box is selected. I didn't catch if he wanted that or not from his post.
    input:focus {
    background: newcolor;
    }

    .... still no need for Javascript.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •