#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    Adelaide
    Posts
    72
    Rep Power
    14

    Javascript and netscape help !!!


    Hi,
    I am using javascript to display a telephone number eg: "123 456 789" on the browser. I also have a drop down list, so based on the location chosen the number is displayed using layers. The ph number is displayed in a straight line eg:

    "123 456 789" in explorer but

    in netscape it is displayed as:
    "123
    456
    789"

    And thats the wierd thing about it!!

    This is the code that I have used for the layers:

    <b><DIV ID="sa" style="position:absolute; LEFT:319; TOP:252; background-color:white; width:100; height:20; visibility:hidden"> 1300 138 149</DIV></b>

    Can anyone tell me why this is happening?? If there is a better way to display these numbers without using a textbox in a browser then do let me know.

    Thanks in advance.

    Regards,

    Yoshi
    Last edited by yoshimitsu; June 17th, 2001 at 05:01 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    200
    Rep Power
    14
    Which version of Netscape are you using?
    I believe you need the <LAYER> tag in NS4.
    In NS6 your code works just fine.

    Btw, perhaps (for some obscure reason) NS is doing a word wrap? Try adding a border to your box so you can see its outline.

    Also (but this has nothing to do with your question), instead of using the <b></b> you should use font-weight: bold in your style definition. Or at least use <strong></strong> tags.

    Another way to solve this is to show the phone number in a normal text field (or a textarea if you need to display more info). So what to do if no selection has been made? How about showing a text "Phonenumber", or disabling the field?
    Also a neat trick is setting the border to none and leaving the content empty. Using a text field has the following advantages: it is supported by all browsers, and it allows you to edit the phonenumber.

IMN logo majestic logo threadwatch logo seochat tools logo