You could translate them into their respective escape sequences using str_replace before passing the string through nl2br(). This is an example: $profile = nl2br(str_replace('\\r\\n', "\r\n", $profile['presentation'])); ...
I realized what i was doing wrong, as I am new to html and css I didn't realize the class that I was calling. I simply needed to add class="form-control" to my <input>. This doesn't fix dynamically creating a red border when the input is invalid unfortunately.
javascript,append,textarea,placeholder
Although I don't quite understand what you want, here's what I think you want: var textarea = document.getElementById('test'); setInterval(function () { textarea.placeholder += ' and on'; }, 1500); <div id="comp"><textarea id='test' placeholder="Write on me now, or else... you will have to watch me write on"></textarea></div> Every 1.5 seconds, and on...
javascript,jquery,html,textarea,dom-events
In your case it would be easier to use native ondragstart event instead of a complex mousedown-move-up implementation, and manipulate the data to drop. Something like this: document.getElementById('img').addEventListener('dragstart', function (e) { e.dataTransfer.setData("text", '[img]' + this.id + '[/img]'); }); A live demo at jsFiddle. Or a delegated version. Notice that you...
javascript,internet-explorer-8,internet-explorer-9,textarea,maxlength
You can access the clipboard content with window.clipboardData.getData('Text') And manipulate it as necessary before placing it in the textbox. Be sure to return false or the paste event will fire and replace what you did. To access the current value, read the innerText value of the textarea. To get the...
I suggest building the markup in a PHP variable, and then echoing the markup all at once: <?php $average = '50'; $myquery = "SELECT `milk_solids`, `tag_number` FROM `milk` "; $row = mysqli_fetch_array($myquery); $MilkSolids = $row['milk_solids']; $TagNumber= $row['tag_number']; if ($row['milk_solids'] > 50) { $msg = 'good feedback message'; }elseif ($Milksolids <...
I've remove sendmessage() and replace button type to submit. Keeping it simple. <?php if(isset($_POST['send'])){ echo "<pre>"; print_r($_POST); $message = $_POST['message']; } ?> <form action="" method="POST"> <textarea name="message" id="msgtype" placeholder="Type your message"></textarea> <input name="send" id="send" type="submit"/> </form> Try it. Hope it'll work....
You width is properly resized because of the default configuration of 'anchor:100%'. On the other hand, the height it's a little bit more difficult, the idea that comes to me now is try to with a particular css (using property cls) manipulate the height (height:'100%') or something like that. Because...
javascript,jquery,html,forms,textarea
You need to use val method <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <form onsubmit="Output()"> <textarea id='area1'>preset</textarea> <input type="submit" value="showme"> </form> <script> function Output() { var s = $('#area1').val(); alert(s); } </script> ...
javascript,html,html5,textarea,caret
Here is some code that will do the job. Basically, extract the caret position. Convert sentence to array. Loop array adding words lengths together, when length is greater than caret position you have found your word. <html> <script> function getCaret(node) { if (node.selectionStart) { return node.selectionStart; } else if (!document.selection)...
c#,winforms,textarea,richtextbox
I found an answer. You can use: Size textSize = TextRenderer.MeasureText(richTextBox1.Text, richTextBox1.Font); for the size of the text then check OnContentResized event whether the MeasureText() is bigger then the height of the rich textbox....
What I need is that I want to print the result of Squre root of a number in the textArea of MainGUI class Problem #1... The JTextArea is not accessiable from outside the initialize method... private void initialize() { //... JTextArea myTextArea = new JTextArea(); You need to make...
Newlines are actually being preserved(as \r\n), you just don't see them in your index/show views. In these views, call simple_format on your post.body field to replace \ns with <br>s(HTML newlines): simple_format(post.body) From docs: simple_format(text, html_options = {}, options = {}) public Returns text transformed into HTML using simple formatting rules....
javascript,forms,validation,textarea
As mentioned in my comment, it depends on what you want to do with n ultimately. If you just want it to show the user a message, you can update the DOM once you've calculated this value. Your current example doesn't allow the user to delete text after they've typed/pasted...
This works for your example: document.querySelector('textarea').addEventListener('paste', function() { var self= this; setTimeout(function() { self.value = self.value.split(/\t+/) .map(function(v, index) { return 'Name'+(index+1)+': '+v; }) .join('\r'); },1); }); Working Fiddle The timeout is needed, because the value of the textarea isn't updated until after the paste event. The text is split on...
javascript,html,forms,textarea
innerHTML returns the HTML structure but it excludes the value property of form elements (such as textarea). Instead, you could create a new element to hold the additional field, then append that element to inputs: function addInput(){ var inpts = document.getElementById("inputs"), inputCounter = Number(document.getElementById("inputCounter").innerHTML), incCount = inputCounter+1, div = document.createElement('div');...
Here is fast demo of what i meant in comment about adding listener to the textRecu. Yep consoleTextArea.textProperty() can't be changed because of a binding. But textRecu has no binding => can be changed and we can add listener to it. import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.ChangeListener; import...
You're using desc for your column, being a MySQL reserved word without escaping it with ticks. Either rename it to something else like "description", or wrap it in ticks: UPDATE giveawayitem SET name=:name, `desc`=:desc ... http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Had you used setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION) it would have signaled the syntax error such as:...
In your table tr:nth-child(odd) td rule change vertical-align: text-top; to vertical-align: top; jsFiddle example...
Try var input = $("#eventText"), output = $("[for=eventText]"), bannedInput = ["test1", "test two"]; input.on("keyup", function (e) { var name = e.target.value.toLowerCase() , match = $.grep(bannedInput, function (value) { return new RegExp(value).test(name) }); if (!!match.length) { output.append( "<br />Please avoid using the following words and/or phrases: " + "<span class=banned>\"" +...
angularjs,input,focus,textarea,richtextbox
This issue should be fixed in the most recent version, v1.3.0. Issue with same root cause: https://github.com/fraywing/textAngular/issues/468 EDIT: I monitor both github issues and a search for newest textAngular questions, I'm on GMT+13 so you may have to wait a day for a response but I usually get back to...
html,css,textarea,padding,browser-scrollbars
I've tried to think of a workaround, depending on your own hint. You've got it right, but didn't implement it yet. :) I just coded your idea. What I did was to enclose within a wrapper, and setting before and after pseudo elements to just hide the top and bottom...
Change innerHTML to value, <textarea id = "textarea">change this</textarea> <div onclick = "change()">click here<div> <script> function change() { document.getElementById( 'textarea' ).value = 'new text'; } </script> a textarea has a value that can be altered, the innerHTML here just sets the initial value....
Using the iOS developer tools via USB on my iPhone, I can see that your font-size: 30px has gone through. The reason @user1273587 could not see this via Chrome dev tools is because your @media selectors only change the font size on mobile. From my testing, the higher the font...
php,textarea,whitespace,simple-html-dom
The PHP trim function will do what you need it to. Just change your file_get_contents($url) to file_get_contents(trim($url)) and it should never have that problem.
It turns out it is a bug on Chromium: Cursor line-height bug on inputs CSS uses what is known as half-leading to render lines of text. This is determined by working out the difference between the line-height and the font-size, dividing by 2, and then placing the calculated amount of...
I'm not sure, if it's possible to achieve exactly what you want (due to the different font size and family), but this snippet is very close to it. function makePreview() { var text = document.getElementById('inputText').value; document.getElementById('outputText').innerHTML = text; } .wrapper { width: 150px; } .wrapper textarea { width: 100%; }...
The textarea doesn't have a value attribute. You have to put your echo statement in between the tags like this: <textarea id="description" name="description"> <?php echo $row['description'];?> </textarea> ...
You can do this by fetching the content node out of the TextArea and applying the style to it. But it works only after the TextArea is shown on the stage. Usage : Node node = textArea.lookup(".content"); node.setStyle("-fx-background-color: black;"); ...
I think this works for you: var text = []; var textarea = document.getElementById('message'); //simple texteditor function edit(tag) { var startPos = textarea.selectionStart; var endPos = textarea.selectionEnd; console.log(startPos); var selectionBefore = textarea.value.substring(0, startPos); var selection = textarea.value.substring(startPos, endPos); var selectionAfter = textarea.value.substring(endPos); var surrounder = selection.replace(selection, "<" + tag +...
jquery,textarea,keypress,var,revert
You are almost there, the this in var origVal = $(this).val() points to the document element. Use a specific textarea selector. var origVal = $('#textarea').val() Updated Fiddle Also, remove origVal from keydown(function(e, origVal). The global origVal is accessible in keydown. ...
You can adapt the textarea height to match the scroll height using the clientHeight vs scrollHeight Here is a working copy of your code var text_to_copy = document.getElementById('p1').textContent; var input = document.createElement("textarea"); var holder = document.getElementById("holder"); document.getElementById('p1').onclick = function(){ holder.appendChild(input); input.id = "textarea_id"; input.style.width = "412px"; input.value = text_to_copy.replace(/\s{1,}/g, '...
In most browsers, the textarea element has default padding. In Chrome the element has 2px of padding on each side, and in IE/FF it has 1px of padding on each side. You need to remove the padding if you want both elements to have the same height: Updated Example #textarea...
You have an infinite loop. while($lines) will continue to run as long as $lines evaluates to true, and I'm not seeing anywhere in your code where the control variable($lines) is unset or set to false. I'm also not seeing anywhere that you would benefit from such a while loop, because...
jquery,html,popup,textarea,smooth
$(function () { $("#trigger").click(function() { $(".text-hidden").toggleClass("text"); }); }); .text-hidden { transform: scaleX(0); transform-origin: 0% 40%; transition: all .5s ease; } .text { transform: scaleX(1); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button id="trigger" type="button">CLICK ME</button> <input type="text" class="text-hidden"></input> You can edit in CSS the way you will hide text area. (opacity, scale, transform,...
Unexpected EOF may occur due to various reasons such as missing parenthesis {, } or missing delimiters ?> or bad if else logic. If everything mentioned above is done right, It shouldn't be a problem to post a text area with new line unless you're using some ajax. If you're...
javascript,jquery,html,textarea
You can simplify your code considerably using event delegation. Simply add a div around all of your inputs. <div id="letters"> <input type="submit" style="font-family:'wingdings'" value="P" style="width:100%" id="A" /> <input type="submit" style="font-family:'wingdings'" value="L" style="width:100%" id="B" /> <!-- etc --> </div> Then your jQuery would only need one event. $(document).ready(function(){ var txt=$('#txtarea'); $("#letters").on('click','input',function()...
Alright, here’s the fixed code and below are all the explanations, etc. Full fixed code along with some other improvements function submit(){ var guestName=document.getElementById('text'); var listData=guestName.value.split('\n'); var listContainer=document.getElementById('list'), listElement=document.createElement("ul"); listContainer.appendChild(listElement); var numberOfListItems=listData.length; var listItem; for(var i=0; i<numberOfListItems; ++i){ listItem=document.createElement("li"); listItem.innerHTML=listData[i];...
You can find the exact dimensions of the text rendered in the text area, once the stage is shown: @Override public void start(Stage primaryStage) { TextArea area = new TextArea("This is some random very long text"); area.setWrapText(true); area.setPrefWidth(200); area.setMaxWidth(200); area.setStyle("-fx-font: 18pt Arial"); StackPane root = new StackPane(area); Scene scene =...
You can use a linear-gradient where the background-size is equal to the line-height defined for the textarea, e.g. http://codepen.io/anon/pen/LELJzy textarea { font-size: 16px; width: 80%; height: 200px; color: #fff; line-height: 1.7em; background: linear-gradient(to bottom, #000 98%, #fff 98%); background-size: 1.7em 1.7em; } Whit this approach you don't need an extra...
html,textarea,visual-web-developer
Depends on how you are storing the values. Remember that HTML and general input from fields following the whitespace rule, it will truncate/condense white space into a single entity. So "Wide String" = "Wide String" and: "Multi-line string here" will be truncated to "Multi-line string here" as you have experienced....
If you want to directly use the text you can use something : <TextArea prefHeight="200.0" prefWidth="200.0" text="${'Multi\nLine\tTab'}" /> In case you want to use in Scene Builder, you can switch to multi-line mode. Switching to multi-line mode, scene builder will insert: for \n 	 for \t ...
You will need to encode the inner tags like so: <textarea><textarea>Hello World.</textarea></textarea> In PHP it's simply a matter of running the file source through htmlspecialchars(). A single pass will not alter the output that is displayed in your editor's textarea....
groovy,textarea,scrollpane,swingbuilder
Just embed the textAreas in a scrollPane: scrollPane(constraints:gbc(gridx:1, gridy:0, gridwidth:REMAINDER, fill:VERTICAL, insets:[20, 300, 85, 0])) { textArea(id:'liste', "commands:\n" + ml.opList,editable:false) } ...
javascript,json,html5,textarea,html-input
Textarea hasn't value attribute. You should put content inside tag: <textarea>VALUE HERE</textarea> You should modify last part of your code in: var deviceDesc = divFormGroupOpening + '<label class="col-md-2 control-label" for="deviceDisplay"> Displayed as: </label>' + divOpeningInput + '<textarea id="deviceDesc" class="form-control" name="deviceDesc" data-val="false">' + data.devices[0].deviceDesc + '</textarea>' + '</div></div>'; ...
javascript,jquery,html,html5,textarea
You can wrap textarea content in a jQuery object then use any relevant method to update it, e.g: var $content = $('<div/>').html($('.mapCode').val()); $content.find('area').attr('coords', selection.x1+','+selection.y1+','+selection.x2+','+selection.y2); $('.mapCode').val($content.html()); -DEMO- ...
Just for a proper answer, I'm posting my comment that fixed the issue: <textarea class="form-control" disabled="disabled"><%#Eval("value") %></textarea> The extra spaces were caused by the code indentation, which textareas treat as user-inputed value....
There is no such limit. The maximum limit i think is gonna be based on the browser or in short browser specific!
I’m going to assume, that because you are wrapping the body content in show.html.erb, that you don’t mind the data in your database but just want to clean it up to present it. Have you tried: <p><%= strip_tags @post.body %></p> Rails API Reference...
javascript,angularjs,select,textarea
Here's a working jsfiddle doing what you ask. Every time you click on a list element it is appended to the textarea. The main function is a generic directive that you can reuse across controllers: myApp.directive('txtArea', function() { return { restrict: 'AE', replace: 'true', scope: {data: '=', model: '=ngModel'}, template:...
php,html,forms,escaping,textarea
Apostrophes have special meaning to SQL, so to get them into the data they need to be "escaped" PHP has a quick function for this that also does some security checks to help prevent your database from getting hacked. $note = mysql_real_escape_string($note); DITTO on moving away from mysql and onto...
javascript,jquery,html,input,textarea
Do it this way var textbox = $("#textbox"); $("#change").click(function () { $input = $("#textbox") $textarea = $("<textarea id='textarea'></textarea>").attr({ id: $input.prop('id'), name: $input.prop('name'), value: $input.val(), onchange: $input.attr('onchange'), tabIndex: $input.prop('tabIndex') }); $input.after($textarea).remove(); }); $("#changetext").click(function () { $textarea = $("#textbox") $input = $("<input></input>").attr({ id: $textarea.prop('id'), name: $textarea.prop('name'), value: $textarea.val(),...
javascript,html,css,input,textarea
The problem is in your document.querySelectorAll you're only selecting all ements of type intput and class input__field. You have to also include type textarea in there. Replace this: [].slice.call( document.querySelectorAll( 'input.input__field' ) ).forEach( function( inputEl ) With: [].slice.call( document.querySelectorAll( 'input.input__field,textarea.input__field' ) ).forEach( function( inputEl ) ...
java,swing,textarea,jtextarea,autoscroll
Okay actually I found out that it didn't work, because the Caret is also set in my Console class and thus overwritten. For all who are interested, this seems like a good aproach to me: textArea.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { try { textArea.setCaretPosition( textArea.getLineStartOffset(textArea.getLineCount() - 1)...
javascript,onclick,textarea,selection
The selection is not lost, but just not shown when textarea is not focused. Try this code on Firefox, Chrome or IE10: http://jsfiddle.net/swwqd700/ HTML part: Address:<br> <textarea id="myTextarea"> California Road </textarea> <p>Click the button to select the contents of the text area.</p> <button id="button">Try it</button> Javascript part: function go() {...
javascript,jquery,html,textarea,htmlspecialchars
To check you can create an element in the DOM, inject the comment into it and use [element].getElementsByTagName('*') to check for any html element. If its length is not 0, there are html elements in the comment. Something like: document.querySelector('#check').addEventListener('click', doCheck); function doCheck(e) { var chkEl = document.createElement('div'), isok, report,...
With textarea use an dot image as background. #contactform textarea { background: url("dot-bg.png"); } ...
javascript,jquery,html,focus,textarea
Try using jQuery's appendTo just after you've cloned it $edit_form.appendTo( $comment_holder ); In other words; .on('click', '.edit', function(e) { e.preventDefault(); var $comment_holder = $(this).closest('li'); var $edit_form = $('.comments form').clone(); $edit_form.appendTo( $comment_holder ).find('textarea').focus(); }); ...
Assuming your text is: 1\r\n 2\r\n 3\r\n You can separate based on the Carriage Return (\r), New Line (\n) characters that marks the end of line (in Windows). Or just the New Line, since Linux will use just New Line for the EOL. http://php.net/manual/en/function.explode.php So let's say for example you...
Need to add HTML attribute wrap="off" in textarea and add overflow:auto . Check here HTML <table> <!-- some rows and cells --> <tr> <td id="content_form_HTMLgenerated" colspan="6"> <textarea wrap="off" id="content_form_HTMLgenerated_textarea"></textarea> </td> </tr> </table> CSS #content_form_HTMLgenerated_textarea { width : 100%; height : 80px; resize : none; border : solid 1px rgba(0, 180,...
javascript,jquery,html,css,textarea
If you know that #wrapper will have a specified height, the you use CSS to get a reasonable fit for the textarea. First, specify a value for the height in the #wrapper rule. Then, set a height for #Form by using absolute positioning and the CSS calc function to set...
If I understand well your question, you want to know if it is possible to include HTML content into a TEXTAREA element. That is not possible, but you can look at the solution proposed by the following post, which consists in using an editable DIV element: Rendering HTML inside textarea...
performance,jar,javafx,textarea
Your code has threading issues: in Java 8 it will just throw IllegalStateExceptions as you are trying to update the UI from a background thread. You need if (event.getCode() == KeyCode.ENTER) { new Timer().schedule( new TimerTask() { int i; @Override public void run() { String message = "hey"+i+"\n"; Platform.runLater(() ->...
Initially, I notice a few issues which might be causing this problem. Try the following instead: // Dijit widgets should not be mixed into the grid with declare. // If you're using 0.3, editor should not be mixed in either, // intended to be applied to specific columns (in 0.4...
A TextArea contains a scroll pane internally. The three things you need to make transparent to make the text area appear transparent are The text area iteself The viewport for the text area's internal scroll pane The content pane that displays the text inside the scroll pane The CSS rule...
javascript,modal-dialog,textarea,bootbox
Convert your newlines \n to <br> using a simple regex: pseudo code: textAreaObjectText.replace(/\n/g, "<br />"); The g flag is necessary here to change all occurrences. We're using String.prototype.replace to send the edited text from the textarea to the alert function. Working example: document.querySelector("button").addEventListener("click", function(){ bootbox.alert(document.querySelector("textArea").value.replace(/\n/g, "<br />")); }); <script...
javascript,jquery,textarea,onchange
When you change the value of an input programmatically no event is raised by default. If you need this behaviour you need to fire the event yourself, eg: $('#foo').val('bar').trigger('change'); ...
Inside the textarea tag you can use the tab character to simulate the columns and the \n to generate new lines. Textarea does not accept a table tag inside it. You can get the data from your database and then separate it using the \n and \t tags. Your code...
Assuming that JavaScript is a possibility, since this seems to be impossible with HTML, I'd suggest: function check() { // the trimmed current-value of the <select> // 'this' is passed automagically from the // addEventListener() method; // String.prototype.trim() removes leading and // trailing white-space from the value: var content =...
javascript,html,textarea,jqmath
i got solution <input type="textarea" name="formula" id="test_formula" onkeyup="paste_formula()" /> <span id="formula_print"></span> script code function paste_formula() { var val = document.getElementById("test_formula").value; val = "$$" + val + "$$"; var di = document.getElementById("formula_print"); di.innerHTML = val; M.parseMath(di); }...
You can use jQuery focus() $('#activate').click(function() { $('#textarea').focus(); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <div id="activate">ACTIVATE</div> <textarea id="textarea"></textarea> ...
java,colors,javafx,textarea,textfield
JavaFX's TextField/TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;"); ...
javascript,string,numbers,textarea
You can use the unary operator (+) to convert the string to a number: var product1 = +x.value.slice(0, place_plus); var product2 = +x.value.slice(place_plus + 1, x.value.length); ...
javascript,jquery,html,textarea,string-length
You need to add input to the list of events that you handle: $foo.on('keydown keyup change input', function() { ... When the user does (for example) Right-click / Cut or Right-click / Paste, its the input event that gets fired....
You need to do in following manner:- <?php $q = "SELECT * FROM `Clients`"; $userData = mysql_query($q); $email = array(); // create an array while($user = mysql_fetch_assoc($userData)){ $email[] = $user['Email']; // assign each email to that array } ?> <textarea><?php echo implode(','$email);?></textarea> // implode the array by `,` now all...
c#,windows,forms,tinymce,textarea
Ok, to answer my own question (maybe others find this useful sometime later): The changes of TinyMCE don't get written back to the textarea field in realtime, so I had to work around that. One solution would be to add something in the javascript header that writes every change back...
You can use the getInsertionPoint method of the TextAreaSkin in your drag handler: TextAreaSkin skin = (TextAreaSkin) target.getSkin(); int insertionPoint = skin.getInsertionPoint(event.getX(), event.getY()); target.positionCaret( insertionPoint); However, the skin class is in com.sun.javafx.*, so with Java 9 coming out you'll probably have to do things differently then. Nobody knows what they'll...
Add a span to the right of your "Enter comments" title, and bind an onclick handler which would simply trigger the click of the "X" button below. That should do your job.
I want to be able to access the last word they typed, which would be on the last line, You can use the Utilities class to help you out: int end = textArea.getDocument().getLength(); int start = Utilities.getRowStart(textArea, end); while (start == end) { end--; start = Utilities.getRowStart(textArea, end); }...
\n is not an html entity. It will not be decoded by that function. Use nl2br to accomplish this like so: echo nl2br(html_entity_decode($postDetails['post_body'])) ...
javascript,html,textarea,line-breaks
you can use replace like this: text = text.replace(/\n/g, "\r\n"); var data = new Blob([text], {type: 'text/plain'}); SEE DEMO...
Use: textarea { resize:vertical;/*will prevent resizing horizontally*/ } ...
Check this link from react docs: React Textarea Value Basically for textArea react does not supports text enclosed within and you rather need to specify that as value or defaultValue. The right way thus is <textarea name="description" value="This is a description." /> or <textarea name="description" defaultValue="This is a description." />...
java,canvas,textarea,jtextarea,game-loop
You don't need to manually paint existing Components you add to your program. Here is a simple example how to display a TextArea over a frame/canvas you paint yourself: Check the comments for further details. package main; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.TextArea; import java.awt.event.WindowAdapter; import...
Maybe try if(strcmp(preg_replace( "/\r|\n/", "", $_POST['text']), html_entity_decode(implode("\n", $array))) != 0){ // SAVE THE TEXT } That's getting a bit hard to read, but essentially preg_replace should strip the newline characters out of your POST data for purposes of comparing it to your original array. Hope this works for you!...
javascript,jquery,html,input,textarea
I think I understand what it is you're trying to get done: You want the user to utilize the previously given input of 35 words which is retrieved from input fields, but also give the user the option to add more. This addition is optional. Check it out here To...
javascript,html,angularjs,textarea,ng-repeat
This does the trick: <div ng-if="field.multivalue == '1'"> <textarea rows="{{field.numberOfValues}}" cols="50"> {{field.theValues.join(" ");}} </textarea> <button type="button" ng-click="addValue(field)">Add value </button> </div> The button runs the following function but is only there for testing: $scope.addValue = function(field) { field.theValues[(field.numberOfValues)] = "aaaa"; field.numberOfValues++; }; But for some reason I am getting an indention on...