FAQ Database Discussion Community


Gap around textarea within a table

css,textarea
I've done some research on removing the gap I've got around a textarea located in a table. Depending on the browser, it appears at the top (IE, Chrome) or bottom (Firefox). <table border="0"> <tr> <form method="POST" action="updatereview.php"> <td class="shrink"> text </td> <td class="shrink"> <select name='update_score'> <option value="1">1</option> <option value="2">2</option> <option...

htmlentities() does it remove return character and carriage return?

php,mysql,pdo,textarea
I am creating a forum with PHP and MySQL with the help of PDO class. I have just started coding the forum and come up with a problem. What I am doing is that $post_body = htmlentities($_POST['post_body']); get the user input like this and then send this to my function...

Creating an calculator with javascript gives unexpected output [duplicate]

javascript,string,numbers,textarea
This question already has an answer here: How do I sum numbers using a prompt, like a simple calculator? [duplicate] 1 answer Heyy guys, I am trying to create an calculator that can sum. What I am trying to do is: Search for the plus, and get the place...

Asp.net textarea add empty string to the value [closed]

c#,asp.net,webforms,textarea
I have the textarea inside repeater <textarea class="form-control" disabled="disabled" > <%#Eval("value") %> </textarea> and when it's have value appear to have empty string in front and end of my string value Empty string in the inspector How to remove the empty string in front and end of the value (Trim)...

Get the lines from textarea and insert to mysql [closed]

php,mysql,insert,textarea
I've been trying to add multiple rows to mysql using textarea. The thing is that i can get all the lines from the textbox but i want to separate them into values using " | " as a separator. $invalid = 0; $inserted = 0; $totalaccounts = 0; $lista =...

Default to original textarea val on Esc

jquery,textarea,keypress,var,revert
I'm trying to make an textarea default to the original value upon hitting esc. I can't seem to pass the origVal from the main code into the keypress if/else. Am I overthinking this or underthinking it? Fiddle: https://jsfiddle.net/kirkbross/brkbcr5c/1/ $(function() { var origVal = $("#textarea").val(); // set original value of textarea...

making the backround of a javafx textArea clear

java,javafx,textarea
I was looking into this whole text area class in java, I was going to use it in my cool GUI i'm making but, when I was looking to make the background clear the only thing I could find is a method that allows you to set the opaqueness. but...

Making a list in HTML from value of textarea

javascript,html,textarea
I need a help to make a list using JavaScript. What I’m trying to do is if user clicked submit button elements in textarea making a list in HTML. HTML: <body> <div class="container"> <div id="main"> <img src=""> </div> </br> <div class="box"> <h3>Guest List:</h3> <textarea id="text"></textarea> </br> <button id="submit" onclick="submit()">Submit</button> </div>...

How many characters can “javascript var keyword” store?

javascript,textarea
I want to create a variable to store the value of textarea by using var keyword. But I don't know exactly about the maximum characters which "var" can store. Can you help me?...

Textarea name given back undefined

php,html,textarea
Getting back $message is undefined. I've tried switching $_POST['message'] to $_POST['send']. it works, but for some reason it won't work with the text-area. I even tried to switch the button type from button to submit. It didn't help. This mistake's given me a real headache. <?php $message = $_POST['message']; ?>...

how to prevent unclearing a textbox when selection is made?

javascript,onclick,textarea,selection
I'm trying to build a texteditor and for that I'm using a textarea to fill in my text My problem is when I click a button the textarea selection is gone. Here is some code to show the problem: <!DOCTYPE html> <html> <body> Address:<br> <textarea id="myTextarea"> California Road </textarea> <p>Click...

textarea $_POST into MySQL with PDO

php,mysql,post,pdo,textarea
I'm trying to post a textarea value to a mysql table... alongside a few other fields & datatypes, using PHP's PDO. All other fields insert appropriately, when I remove the textarea field ('desc') from the insert or update. When I include the textarea ('desc') in my prepared statement... the query...

textarea content inside a .txt file but keep line-breaks

javascript,html,textarea,line-breaks
I have some piece of code that saves value of textarea into a local text file. Everything is seems to work fine but I don't want to lose line breaks. Code & fiddle: HTML <textarea id="textbox">Type something here</textarea> <button id="create">Create file</button> <a download="info.txt" id="downloadlink" style="display:none">Download</a> JS (function () { var...

Understanding of css textarea offsets

html,css,textarea,typography
I made a simple example of textarea on jsfiddle with font-size and line-height. JSFiddle textarea textarea { font-size: 20px; line-height: 4; height: 260px; } <textarea> A A A </textarea> 1) How does browser calculate the AREA_1 height and the AREA_2 height? Why are they different? 2) How does browser calculate...

Is there any way to set maximum length constraint on each row of a textarea field?

html,textarea
I need to fulfill a unique requirement from my client. Attached here is the image, I need to force the user not to enter more than 15 digits per row of a <textarea> field without any spaces. Is this possible with HTML? I thought of using cols attribute but then...

Textarea each line is a new value in the db

php,database,insert,textarea
I'm wondering how I could use the textarea in order to make each line a new value in my database. So for example, I'd put this in a text area: 1 2 3 And then each value (1,2,3) would come up as different values. How can I proceed doing this?...

Textarea input length check in JavaScript

javascript,forms,validation,textarea
I'd like to create an SMS gateway which alerts the user each time when 160 chars are written (or pasted). I need to store a variable n containing number of message parts of 160 chars. The code will be like this, just the n needs to be stored globally. Is...

Keep linebreaks when getting text from tag not not showing up

html,textarea
I'm trying to make myself a file manager, and I managed to make an "edit file" function in PHP. In the main page I do have a textarea, but when I want to edit the main page "source", the text stops exactly where the textarea tag closes (</textarea>) Here's a...

check whether any html tags entered in textarea using javascript

javascript,jquery,html,textarea,htmlspecialchars
I'm having a simple commenting system, where i want the user should not type any html special chars, if they done like that they should give an alert of "html tags not allowed". How to do it? while submitting, a ajax call is passed to another page to store it...

Extra line breaks with simple_format

ruby-on-rails,ruby,textarea
To practice Ruby on Rails, I am creating a blog which includes a text area (following Mackenzie Child's tutorial). Unfortunately, line breaks are included every time I press enter. How can I remove the extra line breaks? show.html.erb <h1><%= @post.title %></h1> <p><%= simple_format(@post.body) %></p> _form.html.erb <div class="form"> <%= form_for @post...

Retrieving lines from textArea - Java

java,textarea
I have created a textArea with two lines of text present by default when the program is run. The user is supposed to type any word, and press enter. They may do this as many times as they want- meaning that the last word typed by them won't necessarily always...

Setting Background of TextArea

css,textarea,javafx-8
I would like to provide for user possiblity to select color of TextArea: private void updateTextArea(){ textArea.setStyle("-fx-text-fill: #" + textColor + "; -fx-background-color: #" + backgroundColor); } however this doesnt change color of whole background. Ive found on the Internet that to change backgroud of text Area I need to...

How correctly specify the textarea width? Using the cols attribute I obtain different width using different browser

html,css,css3,xhtml,textarea
I have some problem with the definition of the width of a textarea So, I have this situation: <div id="dialogReject" title=""> <table style="visibility: hidden;" id="rifiutaTable" border="0" class="standard-table-cls" style="width: 100%!important"> <tbody style="background-color: #ffffff;"> <tr> <td style="font: 16px Verdana,Geneva,Arial,Helvetica,sans-serif !important">Inserire note di rifiuto</td> </tr> <tr> <td> <textarea style="visibility: hidden;" rows="5" cols="70"...

Receiving content of textArea from another class in java (With Code) [closed]

java,class,textarea
I am working on a project which has two classes MainGUI and MainTest. SO my problem is that I want to print the result from Calculations done in MainTest class on the testArea of MainGUI. What I did is that, MainGUI obj=new MainGUI(); \\declared in MainTest class obj.myTextField.setTest("Result"); \\Result from...

Avoid line returns on textarea text

html,css,textarea
I am having an issue with the text in my <textarea> tag. Here is the matter : My web app is a html page which write text on textarea on button click. When you click on this button, here is what the <textarea> shows : As you can see, I...

JavaFX TextArea get caret position from coordinate

java,javafx,textarea,javafx-8
Is it possible to get the caret position (an int) at a screen coordinate (2 double) in JavaFX TextArea?

Compare submitted textarea with initial value

php,html,textarea
I want to output an array (from a text-file) into a textarea, let users change it and afterwards save that array back to the text-file. <textarea name="text"><? echo(html_entity_decode(implode("\n", $array))) ?></textarea> Before the array gets stored back to the text-file, I want to make sure, that actually something was changed. if...

How to access clipboard and current cursor position when pasting in a textarea in IE8/9 before it becomes the current value?

javascript,internet-explorer-8,internet-explorer-9,textarea,maxlength
Since IE8/9 do not support HTML5's maxlength attribute, I need to find a way to prevent pasting too long text into a textarea/input, so I chose to go with the onpaste-attribute/eventhandler via jQuery, see the example code below: $(document).ready(function() { $('textarea[maxlength]').on('paste', function() { var maxlength = $(this).attr('maxlength'); if (this.value.length >=...

How do I allow bootbox to accept multiple lines of code?

javascript,modal-dialog,textarea,bootbox
This code works: <script type="text/javascript"> bootbox.alert("Hello world!"); </script> This code doesn't work: <script type="text/javascript"> bootbox.alert("Hello world!"); </script> If you're gonna ask why I need it like the second one, it's because that value will be based off of a textarea which has multiple lines of code, I somehow need to...

Groovy Swingbuilder: How can i add a scrollpanel to my frame?

groovy,textarea,scrollpane,swingbuilder
I want to add a scrollpane, wich contains a textarea, but i dont know how. So i searched the internet and found some examples, but non of them helped me. This is some of my code: frame = sb.frame(title:"BPNM Builder", size:[600, 400],defaultCloseOperation:WindowConstants.EXIT_ON_CLOSE){ panel(id:'mainpanel',border:BorderFactory.createEmptyBorder(10,10,10,10)){ gridBagLayout() label( text:"out:", constraints: gbc(gridx:0,gridy:0,fill:HORIZONTAL,insets:[0, 0, 323,...

Update form validation on right-click cut/paste

javascript,jquery,html,textarea,string-length
I check the length of user input to give feedback before they attempt to submit the form. Here's my code: var $foo = $("#foo"), $span = $("span") $foo.on('keydown keyup change', function(){ $span.text($foo.val().length); }).trigger('change'); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <textarea id="foo">Ipsum</textarea> <small><span></span> characters.</small> This works correctly for input typed. However, if a user cuts...

How to resize textarea depending on the parent element

javascript,jquery,html,css,textarea
So I need to resize the textarea in this form to take the whole available space in the box depending on the parent element (#wrapper). How do I do that? I will exactly put the negative number calculation more precise when I am sure how much text will go there....

PHP- Display data in textarea

php,mysql,textarea
My goal is to display all emails inside a text area. <?php $q = "SELECT * FROM `Clients`"; $userData = mysql_query($q); while($user = mysql_fetch_assoc($userData)){ echo $user['Email']; } ?> it should echo all info into here: <input type="text" name="text" > I get the information fine from the DB, but im not...

Why does my script not make new lines using keyup?

javascript,textarea,onkeyup
I'm coding a script for my forum which generates a preview of the given string. Here is my js code function MakePreview() { var getText = document.getElementById('inputText').value; document.getElementById('outputText').innerHTML = getText;} Here is my HTML code <article> <h2>What are you doing?</h2> <textarea id="inputText" onkeyup="MakePreview()"></textarea> <br/> <input type="submit" class="button" value="Hello"/> </article> <article>...