FAQ Database Discussion Community


Add borders into a textarea [closed]

html,css,textarea
I need to reproduce this contact form. It's already done, but i got some problems for the textarea. Seems I need to put kinds of "hr" into the textarea, or... or I don't know. Any help would be welcome....

add additional fields while maintaining input content

javascript,html,forms,textarea
I'm trying to make an input form with multiple fields and generate a preview of this content in a div. I would like the user to be able to add additional fields as they wish. I have the basic functionality working but anytime I "add" an additional field, the entered...

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...

Convert HTML text area value to jqmath formula

javascript,html,textarea,jqmath
I am new to jqmath; I have contained a textarea field in my HTML: <textarea cols="30" rows="2" id="mathSrc1"></textarea> I will set mathematical formula in the text area so that it will be displayed in <div> tag: <div id="mathTgt1"></div> This code is available in http://mathscribe.com/author/jqmath.html. But I don't know how to...

JSON data not pulling through for textarea input control

javascript,json,html5,textarea,html-input
I am currently trying to build up some html via javascript and when I try to assign the value attribute of my textarea input control it does not seem to want to pull through, the textarea becomes blank when loaded. Values seem to pull through for normal text type input....

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...

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...

Create text-area dotted on each line

html,css,textarea,border
I would like to make a contactform like this one: http://line25.com/wp-content/uploads/2012/letter-form/20.jpg (a multi-line textarea where each line has a dotted border-bottom, like a notebook. So not just the bottom border of the field) The name and e-mail fields I already have: #contactform input[type="text"]{ border: none; border-bottom: dashed 2px #c9c9c9; width:...

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...

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...

Render multiple values, separated by line break, within a textarea

javascript,html,angularjs,textarea,ng-repeat
I am rendering a dynamic form in angular. When attribute has multiple values I wish to render them within a textarea. Each value on its own line. But cant't get it to work! This is what I have so far: <script type="text/ng-template" id="form_field_text"> <label for="{{field.displayName}}">{{field.displayName}}</label> <br /> <div ng-if="field.multivalue ==...

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...

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?

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...

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...

Replace n-th tab character with a string using Javascript/jQuery

javascript,textarea
I have a line of items in Excel, and when I copy them in a textarea, I have several tab characters. I use this on purpose. Is there a way to replace n-th tab characters with a new line (each) and insert a specific word for each tab? Here is...

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....

Pointers about resizing text area

javascript,regex,textarea
Need some help/pointers.... When the user will click on a p element i want it content to be displayed in an text area so it would be possible to modify the text and etc... The text area will be of a fixed width.Thus when the last character will be at...

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...

Append selected list elements into textarea, add own text

javascript,angularjs,select,textarea
On the basis of this post : Angularjs select elements from list and display in textarea I would like to add functionality : Fill textarea on the basis of chosen elements from the list. Add additional text inserted by user -> when user decides that he/she wants to add element...

jQuery focus() on textarea that belongs to a form dynamicaly added into the page

javascript,jquery,html,focus,textarea
I am dynamically adding a new form into page using clone(), but when I add it I want to make form's textarea focused. I've got the code below but it doesn't work: .on('click', '.edit', function(e) { e.preventDefault(); var $comment_holder = $($(this).closest('li')); var $edit_form = $('.comments form').clone(); $edit_form.find('textarea').focus(); $comment_holder.append($edit_form); }); I...

How to activate a textarea with jquery?

javascript,jquery,textarea
I have a textarea (#textarea), which I want to "activate" when a button (#activate) is clicked. By "activate", I mean the blinking prompt should appear and you should be able to type into the textarea. In other words, clicking on #activate should have the same effect as clicking on the...

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...

I want to check the content of textarea must contains previous inputs' words using javascript

javascript,jquery,html,input,textarea
Is it possible to check the content of textarea must contain previous inputs' all words using javascript or jquery? and if not contains all words than the value of textarea is invalid or will not submit. Please reply me soon. Thanks....

TextArea with Canvas Binding to Rect

java,canvas,textarea,jtextarea,game-loop
I have the problem of this textarea not showing up when I run it. Is there any way to make it show up. BTW its getting called through the gameloop on a class that extends canvas. public void render(Graphics g){ Graphics2D g2d = (Graphics2D) g; if(!initialized) init(); try { test.requestFocus();...

HTML/CSS Textarea and Div are different height

html,css,css3,textarea
I've styled a textarea with min/max width and min height (to allow scaling vertically, but in no other direction), and put a div next to it with the same height. For some reason, although the CSS doesn't lie they're different heights. Anyone know why and if there's a way to...

Java FX Textarea performance issue in .jar

performance,jar,javafx,textarea
I have a TextArea that I would like to be able to append characters or words to over a period of time. I use Timer from java.util and when I run application in Eclipse everthing works ok, but when I export application into .jar I have performance issue. Here is...

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...

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?...

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...

Preserve newline in text area with Ruby on Rails

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). When the text is submitted, all of the newlines are removed. I know variations of the question have been asked already, but I have been unable to replicate any of the...

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?...

Get (altered) textarea content from webBrowser element in C#

c#,windows,forms,tinymce,textarea
I've searched the web for 2 days now and am about to give up on this, but I'm soo close to the final solution... so you're my last hope. ;) I have made a little C# application with Windows Forms GUI that uses a webBrowser element to display an HTML...

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)...

How define textarea content on form edit (Symfony2/TWIG)

forms,symfony2,textarea,twig,value
I want to display a specific content in my editForm textarea so I try like text field but it doesn't work : {{ form_widget(edit_form.description, { 'attr': {'value': 'content'} }) }} {{ form_errors(edit_form.description) }} How can I do it in TWIG ?...

Auto scroll down a TextArea

java,scroll,javafx,textarea
I have a TextArea that doesn't scroll down when I add text in it. I thought using this answer, but my TextArea is connected to a StringProperty like this : consoleTextArea.textProperty().bind(textRecu); So the answer doesn't work for me, is there another way to make my TextArea scroll down every time...

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...

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...

Print text in html textarea tag

php,html,textarea
I have a page that collects data from a database then prints it into another form so the user can update it. It works with the input box, but not the textarea box. Here is the code in the form: <textarea id="description" name="description" value="<?php echo $row['description'];?>"> </textarea> I'm pretty sure...

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"...

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...

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...

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>...

Can't post textarea with newlines/carriage return on submit

php,html,textarea
I'm simply trying to pass the values in a textarea through the post variable (or whatever $_POST is). More specifically I want to include the newline characters in it. Whenever I hit submit I have my code re-direct me to another webpage. <form action="blah.com" method="post"> .... <textarea id="Field15" name="Field15" cols="50"...

Extjs5 Textarea Resizing

resize,textarea,extjs5
I have the following form defined: Ext.define('Admin.view.messaging.MsgDataForm',{ extend: 'Ext.window.Window', xtype: 'msgdataform', title: 'Compose Practice Message', defaultFocus: '[name=subject]', modal: true, layout: 'fit', closable: false, width: 700, items: [{ xtype: 'form', layout: 'anchor', fieldDefaults: {labelWidth: 60,labelAlign: 'right',anchor: '100%'}, padding: 10, items: [{ xtype: 'fieldcontainer', layout: 'hbox', fieldLabel: 'Date', items: [{ xtype: 'datefield',...

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...

Textarea with font-size:30px still autozooms when activated on mobile

html,css,mobile,textarea,zoom
As I understand it, setting a text input's font-size to a size greater than 16px, is supposed to disable the autozoom effect that happens when you activate the text input on a mobile device. I set the font-size to 30px, but the autozoom effect is still there. Tested on Chrome,...

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 =...

Is it possible to set different colors for different lines in a javafx textField/Area?

java,colors,javafx,textarea,textfield
I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable?

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...

Adding psuedo elements to