HTML - Problem With Textarea! Please Help
Helo!
I want to output the data from the database table into my textarea in html/php. I want to align output as it is in database. This is my echo which outputs in textarea. echo "$id |$way | $date | $price | $lenght " . "\n"; Because of different lenghts of data in database, output in textarea is mixed and opaque. So, please tell me how can I "align" this output from database in textbox so it will be inline. Thanks for help! Similar TutorialsMy html form contains a textarea that submits to a Java servlet. When the textarea content includes an ampersand (&), the servlet is treating what comes after the & as a separate parameter. How can I overcome this? Thanks, James Hello, I have a table more o less defined as follows: Code: <table border = 2> <tr><th colspan=2 align=center>GENERAL TABLE NAME</th></tr> <tr><th colspan=2 align = center>ANOTHER GENERAL NAME</th></tr> <tr><th>Col1</th><th>Col2</th></tr> <tr><td>Att1</td><td>Att2</td></tr> <tr><td colspan=2> <textarea cols=??? rows=???> <%=XMLString%=> </textarea></td> </tr> </table> I have the following problem: The table is shown but it needs to be printed... so I cannot use a textarea with scrolling option.... I need the textarea to be completely seen. What I need to write is a XML string... Is there a way of knowing the number of lines contained by this string (so I could put it in the rows parameter)? Another thing, I would like the textarea to completely fit within the 2 columns.... how can I do it? May be is there another way of doing it, without using textarea? Thanks for your help Hello, I've put a contact form on the contact section of my website, here. But I'm having a problem with the last field (the message section). I want the text area to have a scroll bar, so when you're typing and get to the end of the box, it starts typing on a new line. Instead it just keeps typing on the same line and no scrollbar apprears. Thanks in advance for your help!! I'm not sure if anyone is familiar with spiceworks but it's a fairly nifty application, and I'm trying to customize a create ticket form. Things work fine for the most part, the problem I run into is when I create a dropdown menu for users to select a "program code" that populates to a text area. From reading the errors I can see what is happening but I just don't know how to fix it b/c of the way in which this textbox is named. My code is as follows. Code: <form name="form1" action="/portal/new_ticket" class="new-ticket" enctype="multipart/form-data" method="post" onsubmit="Portal.disableSubmit(this);return true"> <input class="text" id="authenticity_token" name="authenticity_token" type="hidden" value="pFUDFH3XRBtjFr+p3+pNaSdbkxj8XJAVcgj9BGcUvPo=" /> <h2>For help with an IT issue you are experiencing, please complete the form below.</h2> <select name="menu" onchange="document.form1.ticket[description].value=document.form1.menu.options[document.form1.menu.selectedIndex].value;" style="background-color: transparent; font-size: 10px; color: rgb(0, 102, 153); font-family: verdana;"> <option value="#">Choose Program Code.</option> <option value="01">01</option> <option value="">02</option> <option value="">03</option> <option value="">04</option> <option value="">05</option> <option value="">06</option> <option value="">07</option> <option value="">08</option> <option value="">09</option> <option value="">10</option> <option value="">11</option> <option value="">12</option> <option value="">13</option> <option value="">14</option> <option value="">15</option> </select> <p class="summary"><label>Summary:</label><input class="text" id="ticket_summary" name="ticket[summary]" type="text" /></p> <p class="description"><label>Description:</label><textarea id="ticket[description]" name="ticket[description]" type="text" value=""></textarea></p> <p class="attachment"><label>Optional attachment: </label><input class="text" id="ticket_attachment" name="ticket[attachment]" type="file" /><a href="#" onclick="return Portal.resetHTML($(this).up('p'));; return false;">clear attachment</a></p> <p class="button"><input name="commit" type="submit" value="Submit Request" /><em class="highlight"></em></p> </form> As you can see the name of the textarea is name="ticket[description]" and when I am assigning the value of the user selection to the textarea, onchange="document.form1.ticket[description].value=document.form1.menu.options[document.form1.menu.selectedIndex].value; the syntax b/c of the name is setup for "ticket" to have a variable "description" passed to it and I am then getting the error "description is not defined" which would make sense. I get the code to work if I simply change the name of the textarea to something like "ticket" but then I get an error when I try to submit the ticket in spiceworks, so it appears I need to find a different way of populating the textarea with out changing the name of the textarea. Is there another way to have my dropdown menu populate the textarea, maybe with javascript, where I can keep the name ticket[description] and not have the compiler thinking I'm trying to pass description? Any help is greatly appreciated. Hi all savvy HTML Experts! I thought I might be able to find here some nice help from the community! I have an FBML page. I want to have a TextArea box according to the Browser. If IE ---> Use TextArea_A Else ( all the rest FF ofcurse and the smaller once ) ---> Use TextArea_B You got the point what I'm trying to achieve right?! different textarea box according to the browser.. So does anyone know a way around this ? Thanks A TON in advance! How can I limit the rows inside a textarea? Im not talking about limiting the visible row. Example I want to have 99 columns and 20 rows only, how can do that? Hello! I'm having a lot of trouble here. I have a form on my website that is linked to my 1shoppingcart account. Unfortunately, the feild for their personalized message is only a single line because it uses the <input> tag instead of the <textarea> tag. But when I use the text area tag instead, I get something that is completely wrong. I'm assuming that it has to do with all of the other 1shoppingcart code that is jumbled in there. Here is the code for the table: <form name="form1" method="post" action="https://www.mcssl.com/app/contactsave.asp"> <input name="merchantid" type="hidden" id="merchantid" value="166866"> <input name="ARThankyouURL" type="hidden" id="ARThankyouURL" value="www.1shoppingcart.com/app/thankyou.asp?ID=166866"> <input name="copyarresponse" type="hidden" id="copyarresponse" value="1"> <input name="custom" type="hidden" id="custom" value="1"> <input name="defaultar" type="hidden" id="defaultar" value="0"> <input name="allowmulti" type="hidden" id="allowmulti" value="0"> <input name="visiblefields" type="hidden" id="visiblefields" value="Name,Email1,Company,Workphone"> <input name="requiredfields" type="hidden" id="requiredfields" value="Name,Email1"> <table width="500"> <tr> <td>Name</td> <td><input name="Name" type="text" size="40"></td> </tr> <tr> <td>Company</td> <td><input name="Company" type="text" size="40"></td> </tr> <tr> <td>Email</td> <td><input name="Email1" type="text" size="40"></td> </tr> <tr> <td>Phone</td> <td><input name="Workphone" type="text" size="40"></td> </tr> <tr> <td>How Did You Hear About Us?</td> <td><input type="hidden" name="fieldname1" value="field1"> <input type="hidden" name="required1" value="1"> <input name="field1" type="text" size="40"></td> </tr> <tr> <td>Message</td> <td><input type="hidden" name="fieldname2" value="field2"> <input type="hidden" name="required2" value="1"> <input name="field2" type="text" size="40"></td> </tr> <tr align="right"> <td colspan="2"> <input type="Submit" name="cmdSubmit" value="Submit"> </td> </tr> </table> </form> I would appreciate any help that you can give! The page that hosts this form is www.36hoursinaday.com/contact-us. Thanks so much! I have these 2 textboxes i want one aligned left and one aligned center. Both of them i want to be next to eachother. How do i do this without a table code? Is there a way to set it so there is a limit to how much text u can input in to a text area.. I know of one way. but i want it to also display under how many letter's you can enter. so say for example i entered.. 10 letters it will say You have got 240 letters left etc.. each time u enter a letter it drops down. anyone know of a way to do this? Hi Hope someone can help. I am new to HTML and i am a bit stuck. I have written a Java script to populate a text box with the contents of a directory and what I want to do is to display a gif or picture whilst the data is getting retrieved. My code is (it is in a grid) <TD><textarea name="files" cols="50" rows="20">test</textarea></TD> What I want is to have the box show a pic as default until the script loads the data. Thanks Paul Hi, I've searched for sometime on this issue but no luck. I've two forms on my html page (say form1 and form2). Both the forms have one text area each (say textarea1 and textarea2). form1 also has a button on clicking which the contents of textarea2 are copied into textarea1. Everything seems so smooth till here. But the real hurdle starts here. Actually, I have an xml in textarea2. This xml has few elements with special characters like "&" and "<" Now when the button on the form1 is clicked the contents are copied into textarea1 and this is passed as a parameter to the servlet which tries to display it in a browser. But the textarea1 is converting all & and < to & and < and thus making it an invalid xml. I would like the special characters to stay the same as they are in textarea2. Any workaround for this? Option2: I even would like to know if there's a way to submit form2 when a button in form1 is clicked. Is it possible? Any help is really appreciated. Thanks. I've been searching for this answer and I just can't get my head wrapped around some the posts that I have read. I have a textarea with this text: aaaa bbbb cccc dddd But when I write this data to a file it writes out like this: aaaabbbbccccdddd I've tried doing this but it doesn't work: PHP Code: $php_string0 = str_replace("<br>","\n", $php_filedata); Thanks for any help...!!! I am trying to build a simple contact form using tables, textfields, lables and textareas. The textfields are ok in both IE and FF but the textarea is bigger in IE than in FF and also the textareas in both are stil out of position to the textfields. This is pretty basic i guess, maybe not. I realise there are differences in formatting in IE and firefox but. So if i.... 1) Insert a form tag 2) Insert a table 3 rows x 2 cols in the form tag (name, email and message) 4) Add a lable in the DW designer to attach to each text field/area then the result looks like this in FF, and this in IE, also i just noticed that the font is a slightly different size and font in both as well, here is my code, this is all the code i am using, HTML Code: <form id="form1" name="form1" method="post" action=""> <table width="39%" border="0"> <tr> <td width="20%"><label for="email">Email:</label></td> <td width="80%"><input name="email" type="text" id="email" /></td> </tr> <tr> <td><label for="name">Name:</label></td> <td><input name="name" type="text" id="name" /></td> </tr> <tr> <td><label for="message">Message:</label></td> <td><textarea name="message" id="message"></textarea></td> </tr> </table> </form> any ideas??? Also i realise you can change the size of the textarea but i don't really see the relationship here with respect to the size of the textfield. Hi, I have a textarea, but I can't put HTML in it. Because when I try it will look different. This is what it put in, in the textarea : HTML Code: <a href="/">Link</a> And when I save/submit, it will look like this Code: <a href=\"/\">Link</a> But maybe it's the cause of the "CMS" is use ( Wordpress ) Steven hiii. im having this difficulty on how to remove the <br> in the textarea when its not supposed to be there. for example... originally html code in the editor: <textarea style="font-family: georgia; font-size: 12px; padding: 2; background-color: transparent;" style="overflow:auto;"> Name: Email: </textarea> then once i insert that codes in the html editor and checked the preview. the results is this within the textarea: <br>Name: <br>Email: so, how do i get rid of those <br> in the textarea? im using the uni.cc domain name with the sitebuilder, by the way. not the paid domain. Hey guys! I am just starting a little thing to open, edit, and display HTML stored in txt files. It works fine until I tried to make it so that when you first open the form it already has the txt file's content inside the textarea (to edit it). Obviously it just displays the raw code! I am wondering if there is a way around this. here is my code; Code: <html> <body> <form action="write.php" method="post"> Content: <br><br> <textarea cols="40" rows="5" name="texttest"> <?php $file = file_get_contents ('text.txt'); Echo $file; ?> </textarea> <br> <INPUT type="submit" name="button1" value="Update"> </form> </body> </html> Any help would be awesome! I'm sure this has been done before, but unfortunately im under the pump somewhat! How do I get a drop down menu to post things to a textarea in html? As in when I select an item from a drop down menu how do i get this selection to show relevant information in a text area below.. TruskyMX Please help Im sure there is post already just haven't looked yet. I have a textarea that I need to add a separator after each entry just prior to submit. For example: John Bill Sue If name=fname then I get fname=JohnBillSue sent with submit form. Is there anyway to separate the names when they arrive at a php file.. Is there a way to parse the text area just before submit and add a separator like John| Sue| Bill| so that I would get fname=John|Sue|Bill| Just anyway to be able to get the original individual names on the other end.. Surely there is a way... Hi, I know how to include default text in a text area box, but is it possible for it to show a .txt file on the server, would the page need to be php for this? thanks Hi! I am stuck with this problem i need to make a textarea where will appear only cyrillic letters, no matter which keyboard is used for typing. Here is an example: http://www.yandex.ru/keyboard_qwerty.html If you write to that textarea you will see that only cyrillic letters will appear ( the "ру" option must be selected, the button can be found on left-bottom ) Is there any attribute for textarea or some html/xhtml declaration I can use to do that or must i use something more complicated for example javascript. Thanks! - grybdo |