[RESOLVED] Text Box Display Size
Results 1 to 3 of 3

Thread: [RESOLVED] Text Box Display Size

  1. #1
    Senior Member
    Join Date
    May 2013
    Location
    NYS
    Posts
    128

    resolved [RESOLVED] Text Box Display Size

    Hi Guys,

    Win 7 HP, XAMPP 1.7.4, PHP 5.3 (same as my Remote Server) and I've only been into PHP for the last few months:

    I seem to have a strange one here: Text boxes in Input Statements, are all displaying the same size regardless of what I give them for a length or maxlength.

    I've created a small file to demonstrate it:

    PHP Code:
    <?php
    session_start
    ();
    header('Cache-Control: no-cache, no-store, must-revalidate'); //HTTP/1.1
    header('Expires: Sun, 01 Jul 2005 00:00:00 GMT');
    header('Pragma: no-cache'); //HTTP/1.0

    echo "<H2>Twayne's Domain E-mail Contact Form<br /></H2>";
        echo 
    " Todays date is ".date(" jS  F Y "). "<br />";


    // ====================== RESET SESSION VIEWS BACK TO >=3 =====================
    // store session data
    if(isset($_SESSION['views']))
    $_SESSION['views']=$_SESSION['views']+1;
    else
    $_SESSION['views']=1;

    if(
    $_SESSION['views'] >= 99) {
    echo 
    "You have reloaded a page or pages too many times. You will have to go back to the website and start over again.";
          echo 
    '<br /><a href="http://spamcop.net">Click here and start over</a>';

    session_destroy();
    die();
    }
    $views $_SESSION['views'];
    ECHO 
    "Views is : " $views;
    ?>

    <!-- ======================================== start Input -->
    <!DOCTYPE html>
    <div align="center">
    <head>
    </head>
    <title> Contact Form </title>

    <form action="twa1.php" method="post">
    <b>First Name: </b>
    <input type="text" name="first" label="first" length="2" maxlength="3" >
    <b>&nbsp;&nbsp;LastName: </b>
    <input type="text" name="last" label="last" length="20" maxlength="5" >
    </form>
    </body>
    </html>
    </div>
    The maxlength attribute IS working however, and imposes a restriction on too many characters. It's only the display boxes that are the wrong sizes. So it doesn't "break" anything, but something's not right.

    And, the resulting browser display Image1.png shows the text boxes much longer onscreen with IE10 and FF, whatever its current version is, regardless of the length and maxlength settings as hopefully the attachment clarifies.
    This is consistent with all of my PHP files for forms, of which I have several, and thus the reason I created this stub.
    Just for gp's I also ran it live on my remote server; same thing with the text box sizes.
    A textarea, less maxlength & length of course is unaffected.

    I've looked through php.ini and a couple of configs for hints or changed settings, but no joy. Besides, I'm not sure what to look for. If it was a local issue, I'd expect it to display the text boxes at the sizes I set. The code above is working code should you wish to check it out on your own server.

    I suppose it might not even be a PHP issue, but it sure seems to be! Again just for grins, I removed the PHP code and renamed it to HTML of course; still the same results, and also when opening the file with IE and FF.

    ARE there any changes to PHP.ini or any other configuration files that could possibly be responsible for this issue?

    Any leads, comments, URLs, etc. would be most appreciated. I've been researching this for over a week now!

    TIA, Rivet`
    Last edited by bradgrafelman; 08-30-2013 at 01:12 PM. Reason: bbcode tags modified

  2. #2
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,401
    Moved to ClientSide Technologies forum since this has nothing to do with PHP. (PHP doesn't know what a "text box" is, let alone how to adjust the size of one.)

    One problem I see is that there is no such attribute called "length"; perhaps you meant size instead? (Ditto for "label" - no such attribute for <input>.)

    When you've got an issue with how your HTML markup is being rendered, first thing you might consider checking is whether or not your document is valid.

  3. #3
    Senior Member
    Join Date
    May 2013
    Location
    NYS
    Posts
    128

    Thumbs up It feels so GOOD when it stops hurting!

    Quote Originally Posted by bradgrafelman View Post
    Moved to ClientSide Technologies forum since this has nothing to do with PHP. (PHP doesn't know what a "text box" is, let alone how to adjust the size of one.)

    One problem I see is that there is no such attribute called "length"; perhaps you meant size instead? (Ditto for "label" - no such attribute for <input>.)

    When you've got an issue with how your HTML markup is being rendered, first thing you might consider checking is whether or not your document is valid.
    OH ... MY ... GOD!!
    I recall now having done a multiple-file search/replace and that's likely where it happened. You're right; I'll turn to W3 first next time!! Thanks for the reminder. "label" though is my own aberration; I might have wanted ID; I'll have to check it out again.
    "size" of course works like a charm; NOW I realize the box sizes were the default sizes; it's amazing I never noticed it, but ... length looked logical and I perpetuated it. Stoopid!!

    My sincere thanks for the comments and also pointing out client-side technologies, too; I'll keep it in mind.

    Regards,

    Rivet`

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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