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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cut & Paste JavaScript Quiz Machine script- editing text box size

    I'm hoping that you may be able to assist me with a question relating to the Cut & Paste JavaScript Quiz Machine script that is contained on the website.

    Following the instructions provided on the website, I was able to successfully get the Quiz machine running in a browser.

    However, I would like to modify the code a little, in particular the size(width and height) of the boxes, where the question number, question, answers a-d, your choice and results. However, for the life of me, whatever I try I can't edit the width.

    See the code below: I have tried changing the size and that doesn't work

    <tr>
    <td ALIGN="RIGHT"><b>a)</b></td>
    <td><div align="left"><left><p><input TYPE="TEXT" NAME="choiceA" SIZE="75"></td>
    </tr>
    <tr>
    <td ALIGN="RIGHT"><b>b)</b></td>
    <td><div align="left"><left><p><input TYPE="TEXT" NAME="choiceB" SIZE="75"></td>
    </tr>
    Last edited by skipleemalt; 03-05-2013 at 04:53 PM. Reason: changing title

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,507 Times in 2,485 Posts
    The align tag is deprecated and obsolete.

    You should use css to position your HTML elements. Tables for this purpose are also very much discouraged.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,455
    Thanks
    0
    Thanked 632 Times in 622 Posts
    Use CSS to define how you want it to look.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    To give you an example:
    Code:
    <head>
    <style type="text/css">
    td.choiceLabel {
        text-align: right;
        font-weight: bold;
    }
    td.choice {
        text-align: left;
    }
    td.choice input {
        width: 250px;
    }    
    // more styles 
    // ...
    </style>
    </head>
    
    ...
    <tr>
        <td class="choiceLabel">a)</td>
        <td class="choice"><input type="text" name="choiceA"></td>
    </tr>
    <tr>
        <td class="choiceLabel">b)</td>
        <td class="choice"><input type="text" name="choiceB"></td>
    </tr>
    ...
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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