Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 19th, 2003, 02:26 PM
zuzupus zuzupus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 82 zuzupus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
textarea

hi,
i created textarea field having row=1 and col=15 and table width=100% and cols=12.
the problem is when i type some contents in this text area and try to print in next line ,the result becomes too long and width of textarea remains same,is it possible to make the printing message width as textarea width

for more clear understanding
<table width=100% cols=12>
<th nowrap>Text</th>
<td>
<textarea rows=1 cols=15></textarea>
</td>
<input type=submit value=save>//clicking on this gave value of text area
<td>this line is for printing in next line</td>using PHP,if i type soem text in this field let say
this forum is best form all other sites,then prints looks like below and - - -> this represnts column width
| Text |
| _______________ |
| |_______________| |
| |
|this forum is best form all other sites|

i want soem thing like below printed message,exactly below text area and equal to width of text area

|_______________|
this forum is best
form allother sites

if anybody helps me out will really be appreciable the figure u cant see properly so just click on edit to see the correct view or by minimizing the window u will be clear what i want

thanks in advance



Reply With Quote
  #2  
Old July 19th, 2003, 02:30 PM
jorgen jorgen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hardenberg, Holland<marquee>
Posts: 284 jorgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: textarea

I don't get the problem, sorry.

Could you post an example somewhere on your FTP so we can see the problem.

Reply With Quote
  #3  
Old July 21st, 2003, 07:39 AM
zuzupus zuzupus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 82 zuzupus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: textarea

php Code:
Original - php Code
  1.  
  2. <?
  3.          include("../settings.php");
  4.          /* Connecting, selecting database */
  5.          $link = mysql_connect("$dbhost", "$dbuser", "$dbpw")
  6.          or die("Could not connect");
  7.  
  8.          mysql_select_db("$dbuser") or die("Could not select database");
  9.  
  10.          $query = "SELECT kunde,projektnr from emp_kunde";
  11.     $result = mysql_query($query) or die("Query failed: $query");
  12.          $kunden = array();
  13.          $projekt = array();
  14.          while ($row = mysql_fetch_assoc($result))
  15.          {
  16.           array_push($kunden, $row["kunde"]);
  17.           array_push($projekt, $row["projektnr"]);
  18.          }
  19.          $query = "SELECT hvorgang,uvorgang,status,soll from emp_details ";
  20.     $result = mysql_query($query) or die("Query failed: $query");
  21.          $getrowmysql_fetch_array($result);
  22.          $hvorgang = array();
  23.          $uvorgang = array();
  24.          $status = array();
  25.          while ($row = mysql_fetch_assoc($result))
  26.          {
  27.           array_push($hvorgang, $row["hvorgang"]);
  28.           array_push($uvorgang, $row["uvorgang"]);
  29.           array_push($status, $row["status"]);
  30.          }
  31.          $kunden = array_unique($kunden);
  32.          $hprojekt = array_unique($projekt);
  33.          $haupt = array_unique($hvorgang);
  34.          $unter = array_unique($uvorgang);
  35.          $hstatus = array_unique($status);
  36.  
  37.         if (isset($HTTP_POST_VARS["datum"]))
  38.         {
  39.             $nr = $HTTP_POST_VARS["nr"];
  40.             $datum = $HTTP_POST_VARS["datum"];
  41.             $von = $HTTP_POST_VARS["von"];
  42.             $bis = $HTTP_POST_VARS["bis"];
  43.             $kunde = $HTTP_POST_VARS["kunde"];
  44.             $projekt = $HTTP_POST_VARS["projekt"];
  45.             $hVorgang = $HTTP_POST_VARS["hvorgang"];
  46.             $uVorgang = $HTTP_POST_VARS["uvorgang"];
  47.             $text = $HTTP_POST_VARS["text"];
  48.             $ist = $HTTP_POST_VARS["ist"];
  49.             $soll = $HTTP_POST_VARS["soll"];
  50.                  $status = $HTTP_POST_VARS["status"];
  51.  
  52.                  $query = "INSERT INTO t_emp";
  53.                  $query.="(nr,datum,von,bis,kunde,projekt,hvorgang,uvorgang,  text,ist,soll,status) values ";
  54.                  $query.="('$nr','$datum','$von','$bis','$kunde','$projekt',  '$hVorgang','$uVorgang','$text','$ist','$soll','$s  tatus')";
  55.             mysql_query($query) or die("Query failed: Insert new row");
  56.             $updatePK = "UPDATE key_generator set id = $nr where name = 't_emp'";
  57.             mysql_query($updatePK) or die("Query failed: Update field 'nr' (PK)");
  58.  
  59.         }
  60.                 /// this is the place to get soll value but problem is nr. filed always incremented by 2
  61.                 $query = "SELECT * FROM t_emp order by nr DESC";
  62.             $result = mysql_query($query) or die("Query failed: Fetch all rows");
  63.                  $query = "SELECT id from key_generator where name = 't_emp'";
  64.                  $pkResult = mysql_query($query) or die("Query failed: Get last Id");
  65.                  $row = mysql_fetch_assoc($pkResult);
  66.             $pk = $row[id];
  67.             $pk++;
  68.  
  69.                  function fillDD($min, $max, $selected) //selected format 12:30
  70.                  {
  71.  
  72.             $sel_bits = explode(":", $selected);
  73.                         for($i=$min; $i<24; $i++) {
  74.           //$i = sprintf('%02d', $i); # set $i to be padded with a 0's  up to 2 characters
  75.           for($j=$max; $j<60; $j+=5) {
  76.                     $j = sprintf('%02d', $j); # set $j to be padded with a 0's up to 2 characters
  77.                     if($i == $sel_bits[0] && $j == $sel_bits[1]) {
  78.                              print("<option SELECTED value='$i:$j'>$i:$j</option>n");
  79.                     }
  80.                         else {
  81.                        print("<option value='$i:$j'>$i:$j</option>n");
  82.                      }
  83.                          }//for($j)
  84.                          } //for($i)
  85.                 }
  86.  
  87.                 $arrDay = array ("So", "Mo", "Di", "Mi", "Do", "Fr","Sa");
  88.                 $D=$arrDay[date(w)];
  89.  
  90. ?>
  91.  
  92.  
  93. <html>
  94.     <head>
  95.         <title>Log-Zeiterfassung</title>
  96.         <link rel="stylesheet" type="text/css" href="../styles/styles.css" />
  97.                  <script language="JavaScript" src="date-picker.js"></script>
  98.                  <SCRIPT LANGUAGE="JavaScript" src="log.js"></script>
  99.                  <SCRIPT language="JavaScript">
  100.                     function calculateIst()
  101.                     {
  102.                              var time =document.forms["tstest"].elements["von"].value.split(":");
  103.                                  vontime=parseInt(time[0]*60)+parseInt(time[1]);
  104.                         var time1 =document.forms["tstest"].elements["bis"].value.split(":");
  105.                                  bistime=parseInt(time1[0]*60) +parseInt(time1[1])
  106.                           diff=(bistime-vontime)
  107.                                  if(diff<0){
  108.                                alert("assure that bis is greater than von")
  109.                             return false
  110.                             }
  111.                             min=(diff%60)
  112.                             hrs=(diff-min)/60
  113.                             if (hrs<=9)
  114.                             hrs="0"+hrs
  115.                             if(min<=9)
  116.                             min="0"+min
  117.               document.forms["tstest"].elements["ist"].value =hrs + ":" + min;
  118.                     }
  119.  
  120.                </script>
  121.  
  122.  
  123.     </head>
  124.  
  125.   <form name="tstest" action="log.phtml" method="post">
  126.       <body leftmargin="0" topmargin="0"  marginwidth="0" marginheight="0" class="mybar">
  127.       <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 width=100% name="rsTable" id=rsTable cols=12>
  128.              <tr bgcolor="#cccccc">
  129.                          <!--<th>&nbsp;</th> -->
  130.                          <!--<th nowrap>Nr.</th>-->
  131.                          <th nowrap>Datum</th>
  132.                          <th nowrap>Von</th>
  133.                          <th nowrap>Bis</th>
  134.                          <th nowrap>Kunde</th>
  135.                          <th nowrap>Projekt</th>
  136.             <th nowrap>H-Vorgang</th>
  137.             <th nowrap>U-Vorgang</th>
  138.             <th nowrap>Text</th>
  139.             <th nowrap>IST</th>
  140.             <th nowrap>Soll</th>
  141.                          <th nowrap>Status</th>
  142.                          <th nowrap>&nbsp;</th>
  143.          </tr>
  144.                     <? if (!isset($HTTP_POST_VARS["Save"])) { ?>
  145.         <tr>
  146.                          <!--<td><a href="edit.phtml"><img src="../img/edit.gif"  border="1"></a></td> -->
  147.                          <input size="1" type="hidden" name="nr" value="<?= $pk ?>">
  148.             <td nowrap align="center">
  149.                               <input size="7" type="text" name="datum" value="<?=$D?> <?= date("d.m.y") ?>">
  150.                               <a href="javascript:show_calendar('tstest.datum');"><img src="../img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>
  151.                          </td>
  152.                          <td  nowrap align="center">
  153.                           <select name="von">
  154.                              <?if( isset($bis) ){
  155.                                      fillDD(0, 0, $bis);
  156.                                  }else{
  157.                                                  //Lets try & select the closest time to now.
  158.                                $mins = date('i');
  159.                                $mins -= ($mins % 5)//subtracts the remainder when divided by 5, from the original number
  160.  
  161.                                      fillDD(0, 0, date('H') . ":" . $mins);
  162.                              } ?>
  163.                                    </select>
  164.                                   <input type="button"  name="now" size="1" value=">" onclick="inputTime();calculateIst()">
  165.                       </td>
  166.  
  167.             <td  nowrap align="center">
  168.                               <!--<input type="text" size="1" class="button" name="clock">-->
  169.                               <select name="bis" onchange="calculateIst()">
  170.                                      <option  value="<?=date('H:i')?>"><? echo (date('H:i')); ?></option>
  171.                     <? fillDD(0, 0, -1); ?>
  172.                             </select>
  173.                             <input type="button"  name="now" size="1" value=">" onclick="insertTime();calculateIst()">
  174.                          </td>
  175.             <td  align="center">
  176.                              <select name="kunde" onchange="redirect(this.options.selectedIndex)">
  177.                                  <? foreach($kunden as  $value) { ?>
  178.                                  <option    value="<?= $value ?>"><?= $value ?></option>
  179.                                  <? } ?>
  180.                              </select>
  181.                          </td>
  182.             <td  align="center">
  183.                              <select name="projekt">
  184.                                  <? foreach($hprojekt as  $value) {
  185.                                   if ($value == "<?= $value ?>") { #set Uncle to the value that you want selected.
  186.                      echo "<option value="$value" selected="selected">$value</option>";
  187.                                  }
  188.                              else {
  189.                                       echo "<option value="$value">$value</option>";
  190.                                   }
  191.                                   } ?>
  192.                              </select>
  193.                          </td>
  194.                          <td align="center">
  195.                              <select name="hvorgang" onchange="redirect1(this.options.selectedIndex)">
  196.                                  <? foreach($haupt as  $value) { ?>
  197.                                  <option  value="<?= $value ?>"><?= $value ?></option>
  198.                                  <? } ?>
  199.                              </select>
  200.                          </td>
  201.             <td  align="center">
  202.                              <select name="uvorgang">
  203.                                  <? foreach($unter as  $value) { ?>
  204.                                  <option value="<?= $value ?>"><?= $value ?></option>
  205.                                  <? } ?>
  206.                         </select>
  207.                          </td>
  208.             <td  align="center">
  209.                              <textarea name="text" class="mybar" id="tar" cols="15" rows="1" onfocus="tarea();" onblur="tarea();" title=""></textarea>
  210.                               <input type="hidden" size="1" name="remLen"  value="20">
  211.                              <img src="../img/edit.gif" onclick="window.open('thewindow.html','newWin','width=150,h  eight=130,top=525,left=800,dependent=yes,alwaysRai  sed=yes,resizable=1')" width="16" height="16" border="0" alt="Edit Text"></a>
  212.                          </td>
  213.             <td bgcolor="#cccccc" align="center"><input size="1" type="text" value="00:00" name="ist" readonly></td>
  214.             <td bgcolor="#cccccc" align="center"><input size="1" type="text" name="soll" value="<?= $getrow["soll"] ?>" readonly></td>
  215.                          <td  align="center">
  216.                              <select name="status">
  217.                                   <? foreach($hstatus as  $value) { ?>
  218.                                  <option selected value="<?= $value ?>"><?= $value ?></option>
  219.                                  <? } ?>
  220.                         </select>
  221.                          </td>
  222.                          <td  align="center">
  223.             <input type="button"  value="S" name="Save" border="1" onclick="go();">
  224.             </td>
  225.           </tr>
  226.  
  227.                <? } ?>
  228.  
  229.                     <? while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
  230.                     <!--<? $date = explode(' ', $line["datum"]); ?>-->
  231.  
  232.            <tr bgcolor="#FACB84">
  233.             <!--<td>&nbsp;</td>-->
  234.                         <!-- <td><?= $line["nr"] ?></td> -->
  235.             <td nowrap align="center"><?= $line["datum"] ?></td>
  236.             <td nowrap align="center"><?= $line["von"] ?></td>
  237.                          <td nowrap align="center"><?= $line["bis"] ?></td>
  238.                          <td nowrap align="center"><?= $line["kunde"] ?></td>
  239.             <td nowrap align="center"><?= $line["projekt"] ?></td>
  240.             <td nowrap align="center"><?= $line["hvorgang"] ?></td>
  241.             <td nowrap align="center"><?= $line["uvorgang"] ?></td>
  242.             <td align="center"><?= $line["text"] ?></td>
  243.             <td nowrap align="center"><?= $line["ist"] ?></td>
  244.             <td nowrap align="center"><?= $line["soll"] ?></td>
  245.                          <td nowrap align="center"><?= $line["status"] ?></td>
  246.           </tr>
  247.     <? } ?>
  248.            </table>
  249.  
  250.     </body>
  251.          <script language="javascript" src="triplecombo.js"></script>
  252.  
  253.         </form>
  254.  
  255.            <script language="JavaScript">
  256.             function go(){
  257.             var myindex=document.forms["tstest"].bis.selectedIndex;
  258.        if (myindex==0) {
  259.        alert("nPlease be sure that time from bis drop-down menu is selected.");
  260.             }
  261.             else {
  262.             document.tstest.submit(); }
  263.             }//submit go()
  264.             /*var times = new Array ();
  265.        function createArray() {
  266.          for (i=0; i<document.tstest.bis.length; i++) {
  267.          times[times.length] = new Option(document.tstest.bis[i].value, document.tstest.bis[i].value);
  268.          }
  269.         } */
  270.              var x = 0;
  271.              function insertTime() {
  272.             time = new Date();
  273.             hour = time.getHours();
  274.             minute = time.getMinutes();
  275.             hour = time.getHours().toString().length < 2 ? "0"+hour : hour;
  276.             minute = minute.toString().length < 2 ? "0"+minute : minute;
  277.                          if (x==1) {
  278.             document.tstest.bis.options[document.tstest.bis.length-1] = null;
  279.                 }
  280.                          var anOption = new Option(hour+":"+minute, hour+":"+minute);
  281.             document.tstest.bis.options[document.tstest.bis.options.length] = anOption
  282.             x = 1;
  283.             document.tstest.bis.options.selectedIndex = document.tstest.bis.options.length-1;
  284.  
  285.         }
  286.              var y = 0;
  287.              function inputTime() {
  288.             time = new Date();
  289.             hour = time.getHours();
  290.             minute = time.getMinutes();
  291.             hour = time.getHours().toString().length < 2 ? "0"+hour : hour;
  292.             minute = minute.toString().length < 2 ? "0"+minute : minute;
  293.                          if (y==1) {
  294.             document.tstest.von.options[document.tstest.von.length-1] = null;
  295.                 }
  296.                          var anOption = new Option(hour+":"+minute, hour+":"+minute);
  297.             document.tstest.von.options[document.tstest.von.options.length] = anOption
  298.             y = 1;
  299.             document.tstest.von.options.selectedIndex = document.tstest.von.options.length-1;
  300.  
  301.         }
  302.  
  303.              function tarea()
  304.         {
  305.             if(document.getElementById)
  306.              {
  307.                      if(document.getElementById("tar").rows == 3)
  308.                      {
  309.                              document.getElementById("tar").rows = 1
  310.                              a = document.getElementById("tar").value
  311.                              //a = a.substring(10)
  312.  
  313.                              if(a)
  314.                              {
  315.                                      document.getElementById("tar").title =  a
  316.                              }
  317.                              else
  318.                              {
  319.                                      document.getElementById("tar").title = ''
  320.                              }
  321.                      }
  322.                      else
  323.                      {
  324.                              document.getElementById("tar").rows = 3
  325.                              document.getElementById("tar").title = ''
  326.                      }
  327.              }
  328.         }
  329.  
  330.  
  331.            </script>
  332.  
  333. </html>
  334.  
  335. <?
  336.     mysql_free_result($result);
  337.     mysql_close($link);
  338. ?>
  339.  


just see the text area field and printing area <?= $line["text"] ?>

for the link http://server2.vitodesign.com/log.phtml

thanks in advance

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > textarea


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.


© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek