HTML problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iulian.ilea

    HTML problem

    Hello,
    I have this: <input name="fileUploa d" type="file" class="subtitle "
    title="GOGOGO" />
    In entire application I have buttons customized. The button that
    appears with <input type="file"... /is a standard button. How can I
    customize it? To be, let's say, coloured in green, orange, or any other
    color...

  • Jim Carlock

    #2
    Re: HTML problem

    "iulian.ile a" <iulian.ilea@gm ail.comwrote:
    I have this: <input name="fileUploa d" type="file" class="subtitle "
    title="GOGOGO" />
    In entire application I have buttons customized. The button that
    appears with <input type="file"... /is a standard button. How can I
    customize it? To be, let's say, coloured in green, orange, or any other
    color...
    That's not really a PHP question. It's a style question, although some
    folks might suggest it's an HTML question (argument accepted with
    limitations).

    <input style="color:#E EEE00;backgroun d-color:#FFAA88;b order:3px outset #FF0000;" ...

    Take a look at one of the CSS newsgroups for help with style
    questions...

    For PHP...

    <?php
    $sFGColor = "color:#EEEE00; ";
    $sBGColor = "background-color:#FFAA88;" ;
    $sBorder = "border:3px outset #FF0000;";
    // ...
    ?>

    <?php
    // ...
    echo("<input style=\"$sFGCol or $sBGColor $sBorder\" ... />\n");
    // ...
    ?>

    Good luck.

    North Carolina Swimming Pool Contractors



    Comment

    • iulian.ilea

      #3
      Re: HTML problem


      Jim Carlock wrote:
      "iulian.ile a" <iulian.ilea@gm ail.comwrote:
      I have this: <input name="fileUploa d" type="file" class="subtitle "
      title="GOGOGO" />
      In entire application I have buttons customized. The button that
      appears with <input type="file"... /is a standard button. How can I
      customize it? To be, let's say, coloured in green, orange, or any other
      color...
      >
      That's not really a PHP question. It's a style question, although some
      folks might suggest it's an HTML question (argument accepted with
      limitations).
      >
      <input style="color:#E EEE00;backgroun d-color:#FFAA88;b order:3px outset #FF0000;" ...
      >
      Take a look at one of the CSS newsgroups for help with style
      questions...
      >
      For PHP...
      >
      <?php
      $sFGColor = "color:#EEEE00; ";
      $sBGColor = "background-color:#FFAA88;" ;
      $sBorder = "border:3px outset #FF0000;";
      // ...
      ?>
      >
      <?php
      // ...
      echo("<input style=\"$sFGCol or $sBGColor $sBorder\" ... />\n");
      // ...
      ?>
      >
      Good luck.
      >
      North Carolina Swimming Pool Contractors
      http://www.aquaticcreationsnc.com/
      :) I tried it before posting here :). The background of the browse
      button doesn't change.

      Comment

      • Jim Carlock

        #4
        Re: HTML problem

        "iulian.ile a" <iulian.ilea@gm ail.comwrote:
        <snip>
        :) I tried it before posting here :). The background of the
        browse button doesn't change.
        ....
        <input name="fileUploa d" type="file" class="subtitle " title="GOGOGO" />
        </snip>

        Post the rest of the code for what you tried, including what's in the
        class="subtitle " style statements, and the DOCTYPE statement at
        the top.

        --
        North Carolina Swimming Pool Contractors



        Comment

        • Jim Carlock

          #5
          Re: HTML problem

          "iulian.ile a" <iulian.ilea@gm ail.comwrote:
          <snip>
          :) I tried it before posting here :). The background of the
          browse button doesn't change.
          ....
          <input name="fileUploa d" type="file" class="subtitle " title="GOGOGO" />
          </snip>

          The type="" should be "button" or "submit". See the following code.

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
          <html>
          <head>
          <title>Test</title>
          <style type="text/css">
          h1 { text-align:center; }
          input { clear:both;marg in:2px auto;width:200p x; }
          ..specialstuff { color:#000000;b ackground-color:#FF8800;b order:3px groove #AAAABB; }
          ..specialstufft ext { color:#000000;b ackground-color:#FF8800;b order:3px inset #660000; }
          ..specialformcl ass { float:left;widt h:100%;border:3 px ridge #660000;text-align:center; }
          p { font-size:8pt;text-align:center; }
          </style></head>
          <body><h1>Tes t Input Colors</h1>
          <div class="specialf ormclass"><form name="specialfo rm">
          <input class="specials tufftext" type="text" name="filename" value="" />
          <input class="specials tuff" type="button" value="SpecialS tuff" />
          </form></div>
          <p><a href="http://www.aquaticcrea tionsnc.com">No rth Carolina Swimming Pool Builders</a></p>
          </body></html>

          North Carolina Swimming Pool Contractors



          Comment

          • Johnny

            #6
            Re: HTML problem


            "Jim Carlock" <anonymous@127. 0.0.1wrote in message
            news:FRaTg.1653 5$K02.10217@tor nado.tampabay.r r.com...
            "iulian.ile a" <iulian.ilea@gm ail.comwrote:
            <snip>
            :) I tried it before posting here :). The background of the
            browse button doesn't change.
            ...
            <input name="fileUploa d" type="file" class="subtitle " title="GOGOGO" />
            </snip>
            >
            The type="" should be "button" or "submit". See the following code.
            >
            he's referring to a file browse button so the type should be type="file"
            just as was said.
            unfortunately changing the background on a file browse input deosn't change
            the button color in most browsers.
            as of right now a solution may be found in the 10th hit searching google for
            "html file browse button background-color" without the quotes.


            Comment

            • Tim Roberts

              #7
              Re: HTML problem

              "Johnny" <removethis.huu anito@hotmail.c omwrote:
              >
              >:) I tried it before posting here :). The background of the
              >browse button doesn't change.
              >...
              ><input name="fileUploa d" type="file" class="subtitle " title="GOGOGO" />
              ></snip>
              >
              >he's referring to a file browse button so the type should be type="file"
              >just as was said.
              >unfortunatel y changing the background on a file browse input deosn't change
              >the button color in most browsers.
              >as of right now a solution may be found in the 10th hit searching google for
              >"html file browse button background-color" without the quotes.
              Well, its not really a "solution", but it does at least confirm that the
              OP's task is impossible in the general case.
              --
              - Tim Roberts, timr@probo.com
              Providenza & Boekelheide, Inc.

              Comment

              • Johnny

                #8
                Re: HTML problem


                "Tim Roberts" <timr@probo.com wrote in message
                news:n51uh2t80m i6s7oirbit39gcj bac6nclsm@4ax.c om...
                "Johnny" <removethis.huu anito@hotmail.c omwrote:
                :) I tried it before posting here :). The background of the
                browse button doesn't change.
                ...
                <input name="fileUploa d" type="file" class="subtitle " title="GOGOGO" />
                </snip>
                he's referring to a file browse button so the type should be type="file"
                just as was said.
                unfortunately changing the background on a file browse input deosn't
                change
                the button color in most browsers.
                as of right now a solution may be found in the 10th hit searching google
                for
                "html file browse button background-color" without the quotes.
                >
                Well, its not really a "solution", but it does at least confirm that the
                OP's task is impossible in the general case.
                You are so right, I guess I was suggesting that what solutions are available
                can be found by googling. For instance look at this code snippet I found
                which works in IE using javascript but it doesn't work in FF:

                <html>
                <head>
                <style>
                <!--
                #button{
                /* browse button styling... */
                background-color: red;
                }

                #fileselect{
                visibility:hidd en; /* hides the input file tag from view */
                } -->
                </style>
                <script type="text/javascript">
                function transferfilenam e(sfilename) {
                document.getEle mentById('fname ').value = sfilename;
                }
                </script>
                </head>
                <body>
                <form id="f1" method="post">
                <input type="file" id="fileselect "
                onchange="trans ferfilename(thi s.value);">
                <input type="text" id="fname" value="">
                <input type="button" id="button" value="Browse.. ."
                onclick="filese lect.click()">
                </form>
                </body>
                </html>


                Comment

                Working...