如何删除Textarea之间的行间距?

编程入门 行业动态 更新时间:2024-10-25 03:29:20
本文介绍了如何删除Textarea之间的行间距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是PHP的新用户。我有一个代码,其中我使用多个文本编辑器与Jquery。通过文本编辑器我存储值在mysql db。之后,我有一个页面,我从数据库获取一些字段,并应用运行操作,如查看更新和删除。 现在这里是我的问题。当我点击更新按钮,它增加行之间的线间距。每次当我更新我的数据,它增加行空间。在div标签中我使用CSS行高标签,但它不为我工作。

这是我的代码。 b

创建文档的代码

test.php 。

<!DOCTYPE html> < html lang =en> < head> < title id ='Description'>通知书。< / title> < link rel =stylesheethref =../../ jqwidgets / styles / jqx.base.csstype =text / css/> < script type =text / javascriptsrc =../../ scripts / jquery-1.11.1.min.js>< / script> < script type =text / javascriptsrc =../../ scripts / demos.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxcore.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxbuttons.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxscrollbar.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxlistbox.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxdropdownlist.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxdropdownbutton.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxcolorpicker.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxwindow.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxeditor.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxtooltip.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxcheckbox.js>< / script> < / head> < body> < script type =text / javascript> $(document).ready(function(){ $('#editor1')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor2')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor3' .jqxEditor({tools:'bold italic underline | left center right'}); $('#editor4')。jqxEditor({}); $('#editor5')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor6')。 }); $('#editor7')。jqxEditor({tools:'bold italic underline | left center right'} ).jqxEditor({tools:'bold italic underline | left center right'}); $('#editor9')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor10')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor11')。jqxEditor({}); }); < / script> < div style =margin-top:30px; width:800px;> < div style =margin:auto; width:60px; height:auto; align:middle> < img src =image / pacra_logo.pngalt =logo> < / div> < div style =margin:auto; width:auto; text-align:center; font-family:'Times New Roman',Times,serif; font-variant:small-caps; font-size: 20px; font-weight:bold> 巴基斯坦信用评级机构有限公司< hr> < / div> < / div> < form action =test1.phpmethod =POST> < div style =margin-top:30px; width:800px;> < div style =width:auto; float:contenteditable =true> < textarea name =editor1id =editor1> NL FY 15-147(-040515)< / textarea> < / div> < div style =margin-top:30px; width:35%; float:left; font-family:'Times New Roman',Times,serif; text-align:left; font -size:14pxcontenteditable =true> < textarea name =editor2id =editor2> < b>先生。沙希德伊斯兰教< / br> 总经理< / br> 石油有限公司< / br> Karachi < / textarea> < / div> < div style =margin-top:30px; margin-left:220px; width:35%; float:left; font-family:'Times New Roman',Times,serif; text -align:right; font-size:14pxcontenteditable =true> < textarea name =editor3id =editor3> < strong>< u>机密< / u>< / strong> < p> 2015年5月4日< / p> < br> < / textarea> < / div> < div style =margin-top:250px; margin-right:auto; width:auto; font-family:'Times New Roman',Times,serif; align:center; font-variant:small-caps; font-size:18px; font-weight:boldcontenteditable =true> < textarea name =editor4id =editor4> 石油有限公司< / br>实体评级更新< / textarea> < / div> < div style =margin-top:25px; width:20%; float:left; font-family:'Times New Roman',Times,serif; text-align :left; font-size:16pxcontenteditable =true> < textarea name =editor5id =editor5> 尊敬的伊斯兰教:< / textarea> < / div> < / div> < div style =clear:both;>< / div> < div style =margin-top:10px; width:800px; text-align:justify; font-family:'Times New Roman',Times,serif; font-size:14pxcontenteditable = > < textarea name =editor6id =editor6> 参考我们与您和您的团队就石油有限公司()的评级进行的沟通和讨论。我们赞赏管理层一直提供所有必要的资料。这使得PACRA能够形成正确的配给意见。< / br> PACRA已决定持有AA类别的评级。这个类别捕获了非常强大的企业的信用。在类别中,评级已修改为AA [以前的评级AA +]。这主要是因为循环债务产生的不确定性已经成为不可分割的一部分。这可能持续到结构改革实施。< / br> 同时,该评级在OMC领域中占据领先地位,其最先进的基础设施以及通过艰难的现金循环管理其财务状况的能力。< / br> 我们正在附上这方面发布的新闻稿。< / br> < / textarea> < / div> < / div> < div style =margin-top:30px; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; font-size:16px contenteditable =true> < textarea name =editor7id =editor7> 您真正的< / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:110px; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; size:16px; font-variant:small-capscontenteditable =true> < textarea name =editor8id =editor8> < strong> ssssssssssssssssssssss< / strong> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin:auto; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; font-size: 16px; contenteditable =true> < textarea name =editor9id =editor9> Cheif运营官员< / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:50px; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; size:16px; contenteditable =true> < textarea name =editor10id =editor10> 包含:1)新闻稿< / textarea> < / div> < div style =margin-top:300px> < input type =submitname =submitvalue =Submit> < input type =submitname =submitvalue =Save> < / div> < / form> < div style =clear:both;>< / div> < div style =margin-top:250px; width:800px; float:left; text-align:center; font-family:'Times New Roman',Times,serif; size:18px;> < hr> < strong> Awami Complex FB-1,Usman Block,New Garden Town,Lahore-54600,Pakistan< / strong> < / br> PABX:92(42)35869507传真:92(42)35830425电子邮件:pacra@pacra < / br> www.pacra < / div> < / div> < / body> < / html>

数据更新代码

edit.php

<?php require' .php'; $ id = null; if(!empty($ _ GET ['id'])){ $ id = $ _REQUEST ['id']; } if(null == $ id){ header(Location:index.php); } // --------------------------------------- --- Update -------------------------------- if(!empty($ _ POST)){ $ editor1 = mysql_real_escape_string($ _ POST ['editor1']); $ editor2 = mysql_real_escape_string($ _ POST ['editor2']); $ editor3 = mysql_real_escape_string($ _ POST ['editor3']); $ editor4 = mysql_real_escape_string($ _ POST ['editor4']); $ editor5 = mysql_real_escape_string($ _ POST ['editor5']); $ editor6 = mysql_real_escape_string($ _ POST ['editor6']); $ editor7 = mysql_real_escape_string($ _ POST ['editor7']); $ editor8 = mysql_real_escape_string($ _ POST ['editor8']); $ editor9 = mysql_real_escape_string($ _ POST ['editor9']); $ editor10 = mysql_real_escape_string($ _ POST ['editor10']); if($ _ POST ['submit'] ==Submit){ $ status = $ _ POST ['submit'];} if($ _ POST ['提交'] ==保存){ $ status = $ _ POST ['submit'];} if批准){ $ status = $ _ POST ['submit'];} if($ _ POST ['submit'] ==Re-Submit){ $ status = $ _ POST ['submit'];} $ valid = true; if($ valid){ $ pdo = Database :: connect(); $ sql =UPDATE test1 set editor1 ='$ editor1',editor2 ='$ editor2',editor3 ='$ editor3', editor4 ='$ editor4',editor5 ='$ editor5' editor6 ='$ editor6', editor7 ='$ editor7',editor8 ='$ editor8',editor9 ='$ editor9', editor10 ='$ editor10',status ='$ status'WHERE id ='$ id'; $ q = $ pdo-> prepare($ sql); $ q-> execute(array($ editor1,$ editor12,$ editor3,$ editor4,$ editor5,$ editor6,$ editor7,$ editor8,$ editor9, $ editor10,$ status, $ id)); Database :: disconnect(); header(Location:index.php); } / * $ query = mysql_query(UPDATE test set editor1 ='$ editor1',editor2 =' $ editor2',editor3 ='$ editor3', editor4 ='$ editor4',editor5 ='$ editor5',editor6 ='$ editor6', editor7 ='$ editor7',editor8 = $ editor8',editor9 ='$ editor9', editor10 ='$ editor10',status ='$ status'WHERE id ='$ id'); header(Location:index.php); * / } else {} $ con = mysqli_connect localhost,root,,pacra1); $ id2 = $ _GET ['id']; $ sql =SELECT * FROM test1 where id ='$ id2'; $ result = mysqli_query($ con,$ sql); $ row =(mysqli_fetch_array($ result,MYSQLI_ASSOC)); $ editor1 =($ row ['editor1']); $ editor2 =($ row ['editor2']); $ editor3 =($ row ['editor3']); $ editor4 =($ row ['editor4']); $ editor5 =($ row ['editor5']); $ editor6 =($ row ['editor6']); $ editor7 =($ row ['editor7']); $ editor8 =($ row ['editor8']); $ editor9 =($ row ['editor9']); $ editor10 =($ row ['editor10']); $ status =($ row ['status']); ?> <!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENwww.w3/TR/xhtml1/DTD/ xhtml1-transitional.dtd> < html xmlns =www.w3/1999/xhtml> < head> < meta http-equiv =Content-Typecontent =text / html; charset = utf-8/> < title>无标题文档< / title> < link rel =stylesheettype =text / csshref =newstyles.css> < link rel =stylesheethref =../../ jqwidgets / styles / jqx.base.csstype =text / css/> < link rel =stylesheethref =// code.jquery/ui/111.4/themes/smoothness/jquery-ui.css\"> < script src =// code.jquery/jquery-1.10.2.js\"> ;</script> < script src =// code.jquery/ui/111.4/jquery-ui.js\"> ;</script> < script type =text / javascriptsrc =../../ scripts / jquery-1.11.1.min.js>< / script> < script type =text / javascriptsrc =../../ scripts / demos.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxcore.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxbuttons.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxscrollbar.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxlistbox.js>< / script> < script type =text / javascriptsrc =.../../ jqwidgets / jqxdropdownlist.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxdropdownbutton.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxcolorpicker.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxwindow.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxeditor.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxtooltip.js>< / script> < script type =text / javascriptsrc =../../ jqwidgets / jqxcheckbox.js>< / script> < / head> < body> < script type =text / javascript> $(document).ready(function(){ $('#editor1')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor2')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor3' .jqxEditor({tools:'bold italic underline | left center right'}); $('#editor4')。jqxEditor({}); $('#editor5')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor6')。 }); $('#editor7')。jqxEditor({tools:'bold italic underline | left center right'} ).jqxEditor({tools:'bold italic underline | left center right'}); $('#editor9')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor10')。jqxEditor({tools:'bold italic underline | left center right'}); $('#editor11')。jqxEditor({}); }); < / script> < div style =margin-top:10px; width:800px> < div style =margin:auto; width:60px; height:auto; align:middle> < img src =image / pacra_logo.pngalt =logo> < / div> < div style =margin:auto; width:auto; text-align:center; font-family:'Times New Roman',Times,serif; font-variant:small-caps; font-size: 20px; font-weight:bold> 信用评级机构有限公司< hr>< / div> < form action =edit.php?id =<?php echo $ id;?> method =POST> < div style =width:30%; float:left; line-height:0.5contenteditable =true> < textarea name =editor1id =editor1> <?php echo!empty(nl2br($ editor1))?(nl2br($ editor1)):'';?> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:30px; width:35%; float:left; font-family:'Times New Roman',Times,serif; text-align:left; font-size:14px ; line-height:0.5contenteditable =true> < textarea name =editor2id =editor2> <?php echo!empty(nl2br($ editor2))?(nl2br($ editor2)):'';?> < / textarea> < / div> < div style =margin-top:30px; margin-left:220px; width:35%; float:left; font-family:'Times New Roman',Times,serif; text-align:right ; font-size:14px; line-height:0.5contenteditable =true> < textarea name =editor3id =editor3> <?php echo!empty(nl2br($ editor3))?(nl2br($ editor3)):'';?> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:40px; margin-right:auto; width:auto; font-family:'Times New Roman',Times,serif; text-align:center; font-variant: small-caps; font-size:18px; font-weight:bold; line-height:0.5contenteditable =true> < textarea name =editor4id =editor4> <?php echo!empty(nl2br($ editor4))?(nl2br($ editor4)):'';?> < / textarea> < / div> < div style =margin-top:20px; width:20%; float:left; font-family:'Times New Roman',Times,serif; text-align:left; font-size:16px ; line-height:0.5contenteditable =true> < textarea name =editor5id =editor5> <?php echo!empty(nl2br($ editor5))?(nl2br($ editor5)):'';?> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:10px; width:800px; text-align:justify; font-family:'Times New Roman',Times,serif; font-size:14px; line-height: 0.5contenteditable =true> < textarea name =editor6id =editor6> <?php echo!empty(nl2br($ editor6))?(nl2br($ editor6)):'';?> < / textarea> < / div> < div style =margin-top:30px; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; size:16pxcontenteditable =true> < textarea name =editor7id =editor7> <?php echo!empty(nl2br($ editor7))?(nl2br($ editor7)):'';?> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:100px; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; font-size:16px; font-variant:small-capscontenteditable =true> < textarea name =editor8id =editor8> <?php echo!empty(nl2br($ editor8))?(nl2br($ editor8)):'';?> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin:auto; width:auto; float:left; text-align:left; font-family:'Times New Roman',Times,serif; font-size:16px; contenteditable =true> < textarea name =editor9id =editor9> <?php echo!empty(nl2br($ editor9))?(nl2br($ editor9)):'';?> < / textarea> < / div> < div style =clear:both;>< / div> < div style =margin-top:40px; width:auto; height:30px float:left; text-align:left; font-family:'Times New Roman',Times,serif; font-size :16px; contenteditable =true> < textarea name =editor10id =editor10> <?php echo!empty(nl2br($ editor10))?(nl2br($ editor10)):'';?> < / textarea> < / div> < div style =margin-top:100px> < input type =submitname =submitvalue =Submit> < input type =submitname =submitvalue =Save> < input type =submitname =submitvalue =Approve> < input type =submitname =submitvalue =Re-Submit> < / div> < / form> < div style =clear:both;>< / div> < div style =margin-top:70px; width:800px; float:left; text-align:center; font-family:'Times New Roman',Times,serif; font-size:18px; > < hr> < strong>< / strong> < / br> PABX:92(42)35869507传真:92(42)35830425电子邮件:pacra@pacra < / br> www.pacra & / div> < / div> < / body> < / html> <?php

解决方案

在 textarea 之间写入内容时,您自己的 textarea 中还需要一个额外的行,您需要将这些内容作为

< textarea name =editor1id =editor1> NL FY 15-147(PSO-040515)< / textarea> < textarea name =editor2id =editor2>< b>先生。沙希德伊斯兰教< / br>总经理< / br>巴基斯坦石油有限公司< / br>卡拉奇< / textarea>

I am new in PHP. I have a code in which i use multiple Text Editor with Jquery. Through Text editor i store values in mysql db. After That i have a page on which i fetch some fields from db and apply crud operations Like View Update and Delete. Now here is my problem. When i click on Update button it increase line spacing between the lines. Every time when i update my data it increase line space. In div tag i use CSS Line Height tag but its not working for me.

Here is my code.

Code for create a document

test.php.

<!DOCTYPE html> <html lang="en"> <head> <title id='Description'>Notification Letter.</title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownbutton.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcolorpicker.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxeditor.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function () { $('#editor1').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor2').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor3').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor4').jqxEditor({ }); $('#editor5').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor6').jqxEditor({ }); $('#editor7').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor8').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor9').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor10').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor11').jqxEditor({ }); }); </script> <div style="margin-top: 30px; width: 800px;"> <div style=" margin:auto; width:60px; height:auto; align: middle"> <img src="image/pacra_logo.png" alt="logo"> </div> <div style="margin:auto; width:auto; text-align:center; font-family:'Times New Roman', Times, serif; font-variant: small-caps; font-size:20px; font-weight:bold"> The Pakistan Credit Rating Agency Limited <hr> </div> </div> <form action="test1.php" method="POST"> <div style="margin-top: 30px; width: 800px;"> <div style="width: auto; float:" contenteditable="true"> <textarea name="editor1" id="editor1"> NL FY 15-147 (-040515) </textarea> </div> <div style=" margin-top:30px; width:35%; float:left; font-family:'Times New Roman', Times, serif; text-align:left; font-size:14px" contenteditable="true"> <textarea name="editor2" id="editor2"> <b>Mr. Shahid Islam </b></br> Managing Director</br> Oil Company Limited</br> Karachi </textarea> </div> <div style=" margin-top:30px; margin-left:220px; width:35%; float:left; font-family:'Times New Roman', Times, serif; text-align:right; font-size:14px" contenteditable="true" > <textarea name="editor3" id="editor3"> <strong><u>Confidential</u></strong> <p>May 04, 2015</p> <br> </textarea> </div> <div style="margin-top:250px; margin-right:auto; width:auto; font-family:'Times New Roman', Times, serif; text-align:center; font-variant:small-caps; font-size:18px; font-weight:bold" contenteditable="true" > <textarea name="editor4" id="editor4"> Oil Company Limited </br>Entity Ratings Update </textarea> </div> <div style=" margin-top:25px; width:20%; float:left; font-family:'Times New Roman', Times, serif; text-align:left; font-size:16px" contenteditable="true" > <textarea name="editor5" id="editor5"> Dear Mr. Islam </textarea> </div> </div> <div style="clear: both;"></div> <div style="margin-top: 10px; width: 800px; text-align:justify; font-family:'Times New Roman', Times, serif; font-size:14px" contenteditable="true" > <textarea name="editor6" id="editor6"> This has reference to our communication and discussion with you and your team regarding rating of Oil Company Limited (). We appreciate that management has been forthcoming in providing all the requisite information. This has enabled PACRA in forming the right ration opinion.</br> PACRA has decided to hold rating with AA category. This category captures credit worthiness of very strong enterprises. Within the category though, the rating has been revised to AA [Previous Rating AA+]. This primarily captures the uncertainty emanating from circular debt, of which has become an inseparable part. This is likely to persist until structural reforms are implemented.</br> At the same time, the rating incorporate leading position in the OMC sector, its state-of-the-art infrastructure and its ability to manage its financial profile through a tough cash cycle.</br> We are enclosing a press release being that issued in this regard.</br> </textarea> </div> </div> <div style="margin-top:30px; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px" contenteditable="true" > <textarea name="editor7" id="editor7"> Yours truly </textarea> </div> <div style="clear: both;"></div> <div style="margin-top:110px; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px; font-variant:small-caps" contenteditable="true" > <textarea name="editor8" id="editor8"> <strong>ssssssssssssssssssssssss</strong> </textarea> </div> <div style="clear: both;"></div> <div style="margin:auto; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px;" contenteditable="true" > <textarea name="editor9" id="editor9"> Cheif Operating Officer </textarea> </div> <div style="clear: both;"></div> <div style="margin-top:50px; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px;" contenteditable="true" > <textarea name="editor10" id="editor10"> Encl: 1) Press Release </textarea> </div> <div style="margin-top:300px"> <input type="submit" name="submit" value="Submit"> <input type="submit" name="submit" value="Save"> </div> </form> <div style="clear: both;"></div> <div style="margin-top:250px; width:800px; float:left; text-align:center; font-family:'Times New Roman', Times, serif; font-size:18px;"> <hr> <strong>Awami Complex FB-1, Usman Block, New Garden Town, Lahore-54600, Pakistan</strong> </br>PABX: 92(42)35869507 Fax: 92(42)35830425 Email: pacra@pacra </br>www.pacra </div> </div> </body> </html>

Code for Data Update

edit.php

<?php require 'database.php'; $id = null; if ( !empty($_GET['id'])) { $id = $_REQUEST['id']; } if ( null==$id ) { header("Location: index.php"); } //------------------------------------------Update-------------------------------- if ( !empty($_POST)) { $editor1 =mysql_real_escape_string($_POST['editor1']); $editor2 =mysql_real_escape_string($_POST['editor2']); $editor3 =mysql_real_escape_string($_POST['editor3']); $editor4 =mysql_real_escape_string($_POST['editor4']); $editor5 =mysql_real_escape_string($_POST['editor5']); $editor6 =mysql_real_escape_string($_POST['editor6']); $editor7 =mysql_real_escape_string($_POST['editor7']); $editor8 =mysql_real_escape_string($_POST['editor8']); $editor9 =mysql_real_escape_string($_POST['editor9']); $editor10 =mysql_real_escape_string($_POST['editor10']); if($_POST['submit'] == "Submit"){ $status=$_POST['submit'];} if($_POST['submit'] == "Save"){ $status=$_POST['submit'];} if($_POST['submit'] == "Approve"){ $status=$_POST['submit'];} if($_POST['submit'] == "Re-Submit"){ $status=$_POST['submit'];} $valid = true; if ($valid) { $pdo = Database::connect(); $sql = "UPDATE test1 set editor1 ='$editor1', editor2 ='$editor2', editor3 ='$editor3', editor4 ='$editor4', editor5 = '$editor5', editor6 ='$editor6', editor7 ='$editor7', editor8 ='$editor8', editor9 ='$editor9', editor10 ='$editor10', status='$status' WHERE id ='$id'"; $q = $pdo->prepare($sql); $q->execute(array($editor1,$editor12,$editor3,$editor4,$editor5,$editor6,$editor7,$editor8,$editor9, $editor10,$status,$id)); Database::disconnect(); header("Location: index.php"); } /*$query = mysql_query("UPDATE test set editor1 ='$editor1', editor2 ='$editor2', editor3 ='$editor3', editor4 ='$editor4', editor5 = '$editor5', editor6 ='$editor6', editor7 ='$editor7', editor8 ='$editor8', editor9 ='$editor9', editor10 ='$editor10', status='$status' WHERE id ='$id'"); header("Location: index.php");*/ } else { } $con=mysqli_connect("localhost","root","","pacra1"); $id2 = $_GET['id']; $sql = "SELECT * FROM test1 where id='$id2'"; $result=mysqli_query($con,$sql); $row= (mysqli_fetch_array($result,MYSQLI_ASSOC)); $editor1 =($row['editor1']); $editor2 =($row['editor2']); $editor3 =($row['editor3']); $editor4 =($row['editor4']); $editor5 =($row['editor5']); $editor6 =($row['editor6']); $editor7 =($row['editor7']); $editor8 =($row['editor8']); $editor9 =($row['editor9']); $editor10 =($row['editor10']); $status =($row['status']); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="www.w3/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" href="newstyles.css"> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="//code.jquery/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery/jquery-1.10.2.js"></script> <script src="//code.jquery/ui/1.11.4/jquery-ui.js"></script> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownbutton.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcolorpicker.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxeditor.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function () { $('#editor1').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor2').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor3').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor4').jqxEditor({ }); $('#editor5').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor6').jqxEditor({ }); $('#editor7').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor8').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor9').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor10').jqxEditor({tools: 'bold italic underline | left center right' }); $('#editor11').jqxEditor({ }); }); </script> <div style="margin-top: 10px; width: 800px"> <div style=" margin:auto; width:60px; height:auto; align: middle"> <img src="image/pacra_logo.png" alt="logo"> </div> <div style="margin:auto; width:auto; text-align:center; font-family:'Times New Roman', Times, serif; font-variant: small-caps; font-size:20px; font-weight:bold"> The Credit Rating Agency Limited <hr></div> <form action="edit.php?id=<?php echo $id; ?>" method="POST" > <div style="width: 30%; float:left; line-height:0.5" contenteditable="true"> <textarea name="editor1" id="editor1"> <?php echo !empty(nl2br($editor1))?(nl2br($editor1)):'';?> </textarea> </div> <div style="clear: both;"></div> <div style=" margin-top:30px; width:35%; float:left; font-family:'Times New Roman', Times, serif; text-align:left; font-size:14px; line-height:0.5" contenteditable="true"> <textarea name="editor2" id="editor2"> <?php echo !empty(nl2br($editor2))?(nl2br($editor2)):'';?> </textarea> </div> <div style=" margin-top:30px; margin-left:220px; width:35%; float:left; font-family:'Times New Roman', Times, serif; text-align:right; font-size:14px; line-height:0.5" contenteditable="true"> <textarea name="editor3" id="editor3"> <?php echo !empty(nl2br($editor3))?(nl2br($editor3)):'';?> </textarea> </div> <div style="clear: both;"></div> <div style="margin-top:40px; margin-right:auto; width:auto; font-family:'Times New Roman', Times, serif; text-align:center; font-variant:small-caps; font-size:18px; font-weight:bold; line-height:0.5" contenteditable="true"> <textarea name="editor4" id="editor4"> <?php echo !empty(nl2br($editor4))?(nl2br($editor4)):'';?> </textarea> </div> <div style=" margin-top:20px; width:20%; float:left; font-family:'Times New Roman', Times, serif; text-align:left; font-size:16px; line-height:0.5" contenteditable="true"> <textarea name="editor5" id="editor5"> <?php echo !empty(nl2br($editor5))?(nl2br($editor5)):'';?> </textarea> </div> <div style="clear: both;"></div> <div style="margin-top: 10px; width: 800px; text-align:justify; font-family:'Times New Roman', Times, serif; font-size:14px; line-height:0.5" contenteditable="true"> <textarea name="editor6" id="editor6"> <?php echo !empty(nl2br($editor6))?(nl2br($editor6)):'';?> </textarea> </div> <div style="margin-top:30px; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px" contenteditable="true"> <textarea name="editor7" id="editor7"> <?php echo !empty(nl2br($editor7))?(nl2br($editor7)):'';?> </textarea> </div> <div style="clear: both;"></div> <div style="margin-top:100px; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px; font-variant:small-caps" contenteditable="true"> <textarea name="editor8" id="editor8"> <?php echo !empty(nl2br($editor8))?(nl2br($editor8)):'';?> </textarea> </div> <div style="clear: both;"></div> <div style="margin:auto; width:auto; float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px;" contenteditable="true"> <textarea name="editor9" id="editor9"> <?php echo !empty(nl2br($editor9))?(nl2br($editor9)):'';?> </textarea> </div> <div style="clear: both;"></div> <div style="margin-top:40px; width:auto; height:30px float:left; text-align:left; font-family:'Times New Roman', Times, serif; font-size:16px;" contenteditable="true"> <textarea name="editor10" id="editor10"> <?php echo !empty(nl2br($editor10))?(nl2br($editor10)):'';?> </textarea> </div> <div style="margin-top:100px"> <input type="submit" name="submit" value="Submit"> <input type="submit" name="submit" value="Save"> <input type="submit" name="submit" value="Approve"> <input type="submit" name="submit" value="Re-Submit"> </div> </form> <div style="clear: both;"></div> <div style="margin-top:70px; width:800px; float:left; text-align:center; font-family:'Times New Roman', Times, serif; font-size:18px;"> <hr> <strong></strong> </br>PABX: 92(42)35869507 Fax: 92(42)35830425 Email: pacra@pacra </br>www.pacra </div> </div> </body> </html> <?php

解决方案

You are adding an extra lines within your textarea by yourself while writing contents between textarea you need to place those content as

<textarea name="editor1" id="editor1">NL FY 15-147 (PSO-040515)</textarea> <textarea name="editor2" id="editor2"><b>Mr. Shahid Islam </b></br> Managing Director</br>Pakistan State Oil Company Limited</br>Karachi</textarea>

更多推荐

如何删除Textarea之间的行间距?

本文发布于:2023-11-12 01:08:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580077.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:行间   Textarea

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!