General discussion

  • Creator
    Topic
  • #2080697

    Setting field size for certain browsers

    Locked

    by kirkk ·

    Netscape Navigator displays textfields much longer than other browsers. So I need to determine which browser is being used, then set the size accordingly. I have the following javascript function:

    function fieldLength()
    {
    if navigator.appName== “Netscape”
    return 20;
    else
    return 40;
    }

    Now I need to plug the value into an input tag somehow:

    I’ve tried “javascript:fieldLength()” and document.write(fieldLength()) invarious syntaxes, but can’t find the right solution. How can I make this work?

All Comments

  • Author
    Replies
    • #3893071

      Setting field size for certain browsers

      by mightyduk ·

      In reply to Setting field size for certain browsers

      to the best of my knowledge, netscape will not let you resize the text box, however, IE does. So if you set the size initially to the size for netscape, and use this javascript it will check for non netscape browsers and set the appropriate size:

      ….

Viewing 0 reply threads