Announcement

Collapse
No announcement yet.

html code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • html code

    does anyone know why when i set a col width on a textarea im getting different results in different browsers? when ive got a css setting the size of the font for the text area but in one browser when i type 1234567890123...etc till 30 and had the col set to 30 it fits. in other browsers it only stops at 25 then word wraps and in another browser it goes to 27 before the wrap happens... why.. why.. why grrr. even though i hate safari its the only one that seems to work




    crap. never mind. i didnt know i could use width: 100% in css for the textarea
    Last edited by Da_elf; 31-08-2009, 07:07 PM.

    ---------------------------------------------------
    MSN addresses are not for newbies or warez users to contact the pros and bug them with
    stupid questions the forum can answer.

  • #2
    Are you coding strictly by hand or do you use DW for reference?

    The only time I ever really have problem with layout is IE 7... It tends to do funny things with fonts and spacing.
    LunarStudio Architectural Renderings
    HDRSource HDR & sIBL Libraries
    Lunarlog - LunarStudio and HDRSource Blog

    Comment


    • #3
      try setting the width of the "textarea" tag in pixel or percent with css, instead of using the "cols" property.
      Marc Lorenz
      ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
      www.marclorenz.com
      www.facebook.com/marclorenzvisualization

      Comment


      • #4
        yeah, thats what i ended up doing. im coding by hand mainly. sometimes i use dreamweaver. had to check up online for the different properties i could use in the css for textareas.

        ---------------------------------------------------
        MSN addresses are not for newbies or warez users to contact the pros and bug them with
        stupid questions the forum can answer.

        Comment


        • #5
          ok this is actually php code
          using functions im trying to use this

          Code:
          function directory_table($theselection, $needed){
          $Sorted=mysql_real_escape_string($_POST['Sortbylist']);
          if ($Sorted == $theselection){
          ?>
            <table border="1" cellpadding="0" cellspacing="2" width="192">
            <tr>
          	<td align="center">First Name</td>
          	<td align="center">Last Name</td>
          	<td align="center">Age</td>
          	<td></td>
          	</tr>
          	<?php	
          $sqluser = "SELECT * FROM User Where Accepted='1' AND UserFirstName!='' ORDER BY $needed ";
          $queryuser = mysql_query($sqluser, $dbConn);
          while ($spu = mysql_fetch_array($queryuser, MYSQL_ASSOC)) {
          	?>
          	<tr>
          	<td align="center"><?=$spu['UserFirstName']?></td>
          	<td align="center"><?=$spu['UserSurname']?></td>
          	<td align="center"><?=$spu['UserAge']?></td>
          	<td><a href="directory_more.php?id=<?=$spu['UserId']?>" target="D Content">VIEW</a></td>
          	</tr>
          <?php } ?>
          	</table> <?php }
          	}
          then using
          Code:
           directory_table("firstname", "FirstName");
          im getting an invalid query and invalist fetch and i dont know why. in theory it should work
          all i want is when you choose (for example) First Name from a dropdown list i want the function to search the MySQL database for people and sort by their FirstName

          ---------------------------------------------------
          MSN addresses are not for newbies or warez users to contact the pros and bug them with
          stupid questions the forum can answer.

          Comment


          • #6
            never mind. once again after banging my head on the table for a long time i realised my problem was i needed to either get rid of my $dbConn or pass the variable into the function

            ---------------------------------------------------
            MSN addresses are not for newbies or warez users to contact the pros and bug them with
            stupid questions the forum can answer.

            Comment


            • #7
              the reason the textarea widths are different is because browsers calculate their size, and that of text inputs, based on character widths

              and each browser uses different font metrics, so even though you've chosen the same font and it's there on the machine, Safari thinks it knows better

              the only all round fix is to use monospace fonts for text input : Courier/Lucida

              Comment


              • #8
                yeah, that first one was figured out. so was the second one. now im trying to pimp google to try to find a solution to javascript. im not that good with it.

                i know with php functions i can put some variables in () and pass them into the function so that when im using the function i just fill in the () with what i need. i would love to do the same with javascript since im changing from using a meta reload which safari doesnt like (stupid safari). now im using an onload newLocation() with javascript however id love to be able to be able to put a variable there so i can reuse that javascript.

                Code:
                <script language="JavaScript" type="text/JavaScript">
                function Myloader() {
                  setTimeout ( "Pageload()", 2000 );
                }
                function Pageload() {
                  window.open("location.html?id=something","target");
                  return false;  
                  }
                </script>
                thats the code im using and i still cant figure it out
                Last edited by Da_elf; 11-09-2009, 12:16 PM.

                ---------------------------------------------------
                MSN addresses are not for newbies or warez users to contact the pros and bug them with
                stupid questions the forum can answer.

                Comment


                • #9
                  could you use a php redirect?
                  only problem is they need to be triggered before *anything* is written to page

                  otherwise you can pass a variable to js

                  function thisisreallyaboutvray(myvar){...}

                  and in the function use myvar without quotes ..

                  on the other hand I'd probably do it in Flash

                  Comment


                  • #10
                    this isnt working at all.
                    Code:
                    <html>
                    <head>
                    <script type="text/javascript">
                    function Myloader(page) {
                      setTimeout ( "Pageload(page)", 2000 );
                    }
                    function Pageload(page){
                      window.open(page,"_blank");
                      return false;  
                      }
                    </script>
                    </head>
                    <body>
                    
                    <form>
                    <input type="button" onclick="Myloader('elfpro3d.html')" value="Call function">
                    </form>
                    
                    </body>
                    </html>

                    ---------------------------------------------------
                    MSN addresses are not for newbies or warez users to contact the pros and bug them with
                    stupid questions the forum can answer.

                    Comment


                    • #11
                      sorry cant see anything else wrong though it doesnt look right somehow

                      try to debug with this sort of thing to see if vaiables are being passed as you expect:
                      alert ("page is"+page);

                      Comment


                      • #12
                        I've tried various combination. the major problem is trying to pass the variable page from the first function Myloader into the second function Pageload.

                        ---------------------------------------------------
                        MSN addresses are not for newbies or warez users to contact the pros and bug them with
                        stupid questions the forum can answer.

                        Comment

                        Working...
                        X