Input field font and Internet Exploder



  • I've made a simple base-25 converter in Javascript. And it works brilliantly... except in Internet Explorer (6.0).

    I have an input field which uses a special font to display the base-25 numbers, and 25 buttons below it to add the number characters to said field. But Explorer temporarily changes the font of the field to the default for certain combinations of those characters, and I can't for the life of me figure out why.
     
    Here's the Javascript in question:
    // Dnifont representation of the numbers 0-24
    var b25table = "0123456789)!@#$%^&*([]\\{}"  // Why doesn't explorer accept const anyway?
     
    function writeDNum( D )
    {
     Base25Field.value += b25table.charAt(D)
     updateB10()
    }
    Simple enough, right? Here's what happens:
     
    Works as expected with...[list][*]Any combination that includes at least one of the first 10 numbers[*]Any single number[/list]
     
    Changes to default font with...[list][*]Any combination of the last 15 numbers[/list]
     
    So... what the heck is going on?


  • I had a similar situation.....

     

    When I was creating a Input box for uploading files I used Javascript to make another input box appear if I had other files that needed to upload.

    But when I uploaded the files it showed the text files in a different font....

     

    Not sure if they are related but I wound up tossing the idea because of other problems anyway...

     Sorry Dude! Good Luck
     



  • I'd say it is one of the DOM bugs. I'd try setting the display font to the one you created each time the content of the field changes, OR changing a static area instead of the input field. Also try adding the number together first and then outpitting it to the box, instead of (as I understand) outputting to the box after each digit added. Some more code would also help.



  • Using javascript to change an input field is soooooo 1996.



  • IE contains more of such quirks.

    IE7, as far as I can hypothesize, will not render fonts with cleartype for specific elements on a page if those elements are generated or poked/modified in a certain way by javascript. So now I have a page that's all cleartypey and stuff, except the JS menu*. Same thing happened to a button adorned with PNG alhpa images: aliased, pixelly text.
     

    *) I wrote a noscript version of the menu, and I think it's better than the js popup menu. Heh. Go figure.



  • Thanks for the replies, folks.

    Using a static area works, but I decided to go with prepending a zero whenever Explorer was used.


  • Why are you using punctuation as number symbols instead of following the convention set by hexadecimal?

     

    Also, why base 25?? 



  • This should answer both sufficiently.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.