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
    Oct 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Help with Output colors for Forms

    Hey guys,
    I need a little help here. For some reason, I can't get the font color of the input as red. Here's what I have so far:

    The initial input page:

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html">
    <title>Data Input</title>

    </head>

    <body bgcolor="white">
    <form style="color:red" action="function.php" method="GET">
    <br> Input any word or phrase:
    <input size="big" type="text" name="word" value="">
    <br><input type ="submit" value="submit">
    </form>
    <br><a href="index.php">Home</a>
    </html>





    The output page: (I want only what the user input is to be red)


    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html">
    <title>echo</title>
    </head>
    <body>
    <?php
    print "<h1>You have input: ";
    if (isset($_GET['word']))
    echo strtoupper($_GET['word']);

    ?>
    </body>
    </html>



    Any ideas?

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,468
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    echo "<span style='color:#ff0000;'>".strtoupper($_GET['word'])."</span>";

  • Users who have thanked mlseim for this post:

    ommoi (10-20-2012)

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for your help!

    Do you know of a way to get it to work by implementing it into the 1st code rather than the 2nd code?

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Add your style tag to the input tag instead of the form.


  •  

    Posting Permissions

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