visitor Posted December 23, 2012 Share Posted December 23, 2012 Hi Data is entered directly into the database (phpMyAdmin). When this data then is then looked up on the website, it shows only a part of the first line as the table is too small. The textarea must be dynamic as texts vary in size. Does anyone have a good idea how this problem can be solved best? Dok2.doc <tr> <td input type="textarea" class="fieldset"><div class="tbl_lbl">FUND STRATEGY</div> <div class="tbl_input"> <input size="57" name="fund_strategy" id="fund_strategy" value="<?php echo $arrayFund[0]['fund_strategy']?></textarea> </div></td> </tr> Thank you Quote Link to comment Share on other sites More sharing options...
Johns3n Posted December 23, 2012 Share Posted December 23, 2012 <tr> <td input type="textarea" class="fieldset"><div class="tbl_lbl">FUND STRATEGY</div> <div class="tbl_input"> <input size="57" name="fund_strategy" id="fund_strategy" value="<?php echo $arrayFund[0]['fund_strategy']?></textarea> </div></td> </tr> That looks confusing as hell? Shouldn't it be more like this? <tr> <td class="fieldset"> <div class="tbl_lbl">FUND STRATEGY</div> <div class="tbl_input"> <textarea size="57" name="fund_strategy" id="fund_strategy"> <?php echo $arrayFund[0]['fund_strategy']?> </textarea> </div> </td> </tr> Quote Link to comment Share on other sites More sharing options...
visitor Posted December 23, 2012 Author Share Posted December 23, 2012 Yes, I know... I am working on it, though. But still, even when I try to increase the textarea, it stays the same. I tried this <textarea width="300px" name="fund_strategy" id="fund_strategy"> and how can I get the text from database inside this textarea field? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted December 23, 2012 Share Posted December 23, 2012 You should try this first: http://bit.ly/10844Qg Quote Link to comment Share on other sites More sharing options...
visitor Posted December 23, 2012 Author Share Posted December 23, 2012 Thanks for the link... I am getting there slowly Quote Link to comment Share on other sites More sharing options...
visitor Posted December 23, 2012 Author Share Posted December 23, 2012 So, I finally thought I have found some code to expand the textarea dynamically. But no... anyway, here's the javascript code to this textarea. If someone has got a code that works, please let me know. Thanks <tr> <td class="fieldset"> <div class="tbl_lbl">FUND STRATEGY</div> <div class="tbl_input"> <textarea id="fund_strategy" onkeyup="new do_resize(this);" cols="43" rows="1" name="fund_strategy"> <?php echo $arrayFund[0]['fund_strategy']?></textarea> </textarea> </div> </td> </tr> function do_resize(textbox) { var maxrows=5; var txt=textbox.value; var cols=textbox.cols; var arraytxt=textbox.split('\n'); var rows=arraytxt.length; for (i=0;imaxrows) textbox.rows=maxrows; else textbox.rows=rows; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.