w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
bootstrap wysiwyg: how to get the formatted text on the server side?
<textarea class="textarea" name="mytext" placeholder="Enter text ..." style="width: 810px; height: 200px"></textarea> use val() $('.textarea').wysihtml5(); $('.textarea').val(); http://jsfiddle.net/suhailvs/vNPAJ/3/ you can get it as post request.POST['mytext']

Categories : Twitter

How to change the text color in WYSIWYG Editor
First of all, if your WYSIWYG has color formating you can use it. If not that I consider so, every WYSIWYG editor has a source view that you can edit source and then with inline styling you can color your text I've used TinyMCE and I've done this like this <div> <p style="text-align: center; color: red;">saasdasddd</p> </div> not my text color is red

Categories : HTML

Using Bootstrap wysiwyg text editor in Django Form
Are you sure that this "plugin" doesn't work with textarea? {{ Article_Form.Article_text }} will be rendered to something like: <textarea cols="40" id="id_Article_text" name="Article_text" rows="10"></textarea> So there is a chance that you can initialize the wysiwyg editor like: $('#id_Article_text').wysiwyg(); However after checking the plugin, I doubt that would be possible since it is using contenteditable="true" attribute of HTML5 and probably the plugin works with div only. So there is no way you can make it work natively with Django form. The solution should be display other fields of your form manually, hide the one with textarea and display the editor instead: <form action="" method="POST"> {{ Article_Form.field1 }} {{ Article_Form.field2 }}

Categories : Django

Dnn text editor doesn't change form a basic text box to Rich text box
What version of DNN are you using? If you're using DNN7 you will want to make sure you are using the RadEditor controller, not FCK which it appears to be. DNN7 doesn't work with the FCK Editor.

Categories : Asp Net

Rich Text Editor (YUI Simple Text Editor used) not sending data to next page
The saveHTML() method you used does not seem to save the value to the textarea element. And because the browser doesn't care about YUI Editor and just submits what is there already in the textarea (which is null), it submits the input as null.. You should set the value of the textarea to the editor value so the browser will submit that value instead of null.. Which can be achieved using this little line: document.getElementsById("msgpost").value = html; See this working JsFiddle I made for you. However you had HTML syntax errors too. The onSubmit attribute should be on the form element not the submit button. And listening to the event is not practical when you can simply call a function when the form submits.. (See the JsFiddle)

Categories : Javascript

Keep the text in ckeditor text editor after getting error of form_validation in codeigniter
Have you added a validation for news_Body ? If not, set_value will not work.;

Categories : Codeigniter

Save formatted text to database and retrieve it back 'as is' like a formatted string
Basically, the simplest way to do this is through adding a hidden field to your form and a click event handler on the submit button. so, create a hidden input on your format, with the name "message_formatted" (since I imagine your corresponding field in your model is called message_formatted), and change the name of your textarea to something else, as that will no longer be important. using jQuery: $('#signup input[type=submit]').click(function(e){ $('input[name=message_formatted]').val(tinyMCE.get('content id').getContent()); }); In terms of where to add the javascript, that's up to you. It's best to place it in a javascripts directory (it's unclear whether you're using Rails and the asset pipeline or not). If you want to just add the javascript inline within this haml page, plac

Categories : Javascript

How can I modify this theme to prevent Button text from overlapping the TextView text?
Try Linear layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout1" android:layout_width="match_parent" android:layout_height="fill_parent" android:orientation="horizontal"> <LinearLayout android:id="@+id/layout2" android:layout_width="match_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TextView android:id="@+id/txtBlock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="[Block Name]" android:textSize="15sp" android:layout_gravity="center" /> <Button android:g

Categories : Android

UIPickerView as a button action & set the text of a text field from the selected value of the picker
You need to show your picker from other view, UIActionSheet for example: - (IBAction)commandButton:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"sasdasd" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; [actionSheet showInView:self.view]; [actionSheet setBounds:CGRectMake(0, 0, 320, 470.0)]; //your values commandPicker = [[UIPickerView alloc]init]; commandPicker.delegate = self; commandPicker.dataSource = self; [commandPicker sizeToFit]; commandPicker.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); commandPicker.showsSelectionIndicator = YES; [actionSheet addSubview:commandPicker]; } For set selected value of picker use selectRow:inComponent:animated: method. For exam

Categories : Iphone

Disable OK button when text in text box is no longer correct format in C# Form
if (regex.IsMatch(textBoxPin.Text)) { buttonOK.Enabled = true; } else { buttonOK.Enabled = false; } Would that not work? Shortened: buttonOk.Enabled = regex.IsMatch(textBoxPin.Text)

Categories : C#

Insert text to wysiwyg from dropdown
You can't simply access the textarea from the containing page's DOM since the actual WYSIWYG editor is in an iFrame with .wysihtml5-sandbox. So to access the iFrame's DOM and modify it, we'll have to first access the iFrame DOM: $('.wysihtml5-sandbox').contents() //Now we have the iFrame DOM to apply selectors to $('.textarea', $('.wysihtml5-sandbox').contents()) //Now we have access to the textarea which contains the editor's current text $('.textarea', $('.wysihtml5-sandbox').contents()).append('Hello World!') //Now we have appended content to the editor view, the original goal Extra stuff: $('.textarea', $('.wysihtml5-sandbox').contents()).removeClass('placeholder') //Stops the text from being formatted as a placeholder (i.e. grayed out) $('.textarea', $('.wysihtml5-

Categories : Jquery

Text only thing visible after pausing GLSurfaceView on Galaxy S3 - Text blur when moved. No button backgrounds
It turns out I was calling the function to setup openGL on the UI Thread. I was calling my draw() (etc) methods in the thread created by the Renderer attached to my GLSurfaceView . Because the setup method was being called on the UI thread the openGL used for hardware acceleration was being corrupted. TL;DR: don't make ANY (even setup) calls outside of the Renderer class used for GLSurfaceView as it creates a separate thread so your openGL calls don't interfere with the openGL running on the UI Thread used for hardware acceleration. An easy test to see if your app is plagued by this issue is to disable hardware acceleration in your android manifest and check whether the issue goes away or not: <application android:hardwareAccelerated="false" ...> I hope this helps someone else

Categories : Android

Adding "new line"s to text in text supporting objects (i.e Buttons, Rich Text boxs) both in and out of code
" " is the escaped character for a line break. So code like: label.Text = "This is a button"; Should put the word button on a new line. Edit: If you want to do it using the properties window in designer, click on the arrow on the far right of the text property field and it will open a small box. If you type multiple lines on that as you would normally (ie actually pressing enter, not using ) then the component will treat them as new lines and put the new lines in for you.

Categories : C#

Ignoring leading whitespace in the "lazy-text" quasiquoter in Haskell Text.Shakespeare.Text
It doesn't appear to, however it isn't hard to add the feature yourself. lt is just a QuasiQuoter, which is the data type: QuasiQuoter { quoteExp :: String -> Q Exp , quotePat :: String -> Q Pat , quoteType :: String -> Q Type , quoteDec :: String -> Q [Dec] } They take a String, and return the appropriate template haskell type (depending on the context it is used in. It is a simple matter to transform a string so it works as you described with a regex: stripWhiteSpaceBeforeBackslash :: String -> String stripWhiteSpaceBeforeBackslash str = subRegex (mkRegex "^[[:space:]]*\\") str "" Also, a function that transforms a QuasiQuoter with a string transform function is simple: transformQuasiQuoter :: (String -> String) -> QuasiQuoter -> QuasiQuoter transfo

Categories : Haskell

Give a block of text, some keyshorts, and the target text, how to get the minimal key press to convert the text?
It's probably NP-hard. This paper gives a hardness proof for an editor where insertions, deletions, and substring moves all have constant cost. %0 Book Section %D 2002 %@ 978-3-540-43862-5 %B Combinatorial Pattern Matching %V 2373 %S Lecture Notes in Computer Science %E Apostolico, Alberto %E Takeda, Masayuki %R 10.1007/3-540-45452-7_9 %T Edit Distance with Move Operations %U http://dx.doi.org/10.1007/3-540-45452-7_9 %I Springer Berlin Heidelberg %8 2002-01-01 %A Shapira, Dana %A Storer, JamesA. %P 85-98 %G English

Categories : Algorithm

Change encoding of text file (shell archive or script for antique kernel text to ASCII text, with CRLF, LF line terminators)
Unix uses a single character for line termination. If you want to convert your file with CRLF to single character termination, you can do the following: sed -e 's/<CTRL-V><CTRL_M>//' filename where <CTRL-V> is the Control key pressed with V (do not include < and > characters in the command.

Categories : Bash

Checkbox - check add text, uncheck remove original text in text area
So you want different activity depending on whether your text box is being checked or unchecked. At the moment, you call one method whenever you click on the checkbox, so now you need to look at the state of the checkbox, when it is clicked on. Give your checkbox an ID, and swap out your Javascript for this. <script language="javascript" type="text/javascript"> function moveNumbers(num) { if(document.getElementById("checkBoxId").checked){ var txt=document.getElementById("result").value; txt=txt + num; document.getElementById("result").value=txt; } else{ document.getElementById("result").value=txt=""; } } </script>

Categories : PHP

To copy the selected Text from a div to a text field on double click the Text
Here is how to get the selected text with double click, Update : now it also copies to last focused input. First you need to set focus one of the inputs before double click the text. DEMO http://jsfiddle.net/yeyene/GYuBv/15/ $(document).ready(function () { $("input[type=text]").focus(function(){ $("input[type=text]").removeClass('lastFocus'); $(this).addClass('lastFocus'); }); $('#myDiv').dblclick(function() { $('#selected').append(getSelectionText()); $("input[type=text].lastFocus").val($("input[type=text].lastFocus").val()+getSelectionText()); }); }); function getSelectionText() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && d

Categories : PHP

Android - hidden text --> show text for 2 seconds --> hide text again
Try the following: Show "I'm thinking" Calculate your move but don't actually do the move, just store it for a while Schedule timer When timer runs out remove the text and do the move Something like this: onAndroidTurn(){ textView1.setVisibility(View.VISIBLE); saveMove(calculateNextMove()); new Handler().postDelayed(new Runnable(){ void run() { textView1.setVisibility(View.GONE); doNextMove(restoreMove()); } }, 2000); }

Categories : Java

Multiple Check box input to text area - add text - remove text from text area
If you want to arbitrarily add text that is not known in advance and then later remove it, you'll need to either keep a list of items that have been added and regenerate the result each time, or do a search/replace operation to remove it. I think keeping the list is easier: var itemsAdded = Array(); function moveNumbers(text) { var i = itemsAdded.indexOf(text) if ( i >= 0) { itemsAdded.splice(i,1); } else { itemsAdded.push(text); } document.getElementById("result").value=itemsAdded.join(" "); //if you want each on a separate line, use " " instead of " " }

Categories : PHP

Mirroring with Ace Editor. How to Remove Text of Mirrored Editor
You can use mirror class from https://github.com/ajaxorg/ace/blob/master/lib/ace/worker/mirror.js

Categories : Javascript

How to increase Joomla text area (WYSIWYG ) Numbers of characters or lines allowed?
The textarea size in the Article Manager's TinyMCE editor of Joomla 2.5 is annoyingly small, especially for people used to the larger editable area that was available in Joomla 1.5. You can change the height of this by clicking on the diagonal lined area at the bottom right hand corner and dragging up and down, but the size will reset after each session has ended. Here's how you can hardcode a height size of your choice... Edit the file found in... plugins/editors/tinymce/tinymce.php Then change line 723 (or thereabouts) from... $editor = '<textarea name="' . $name . '" id="' . $id .'" cols="'. $col .'" rows="' . $row . '" style="width: ' . $width . '; height:' . $height . ';" class="mce_editable">' . $content . "</textarea> " . to... $editor = '<textarea name="' .

Categories : HTML

Inserting text from text file into MySQL TEXT column
This is a possible duplicate of this question: http://serverfault.com/questions/316691/mysql-binlog-format-dilemma Anyway, the key is Statement is unsafe because it uses a system function that may return a different value on the slave. When the MySQL database is setup to use replication, system functions like load_file can cause issues. The file C: emp exttoinset.txt is likely different between the master server and the slave server (or may not even exist on one of them). When using replication, it is best to avoid system functions (like load_file and NOW()) because the values will be different when executed on different servers. If you want to load a file into a MySQL database that uses replication, consider using PHP's file_get_contents to read the file, and then use that to insert

Categories : PHP

How do I reload the formatted text into RTB?
You need RichTextBox1.SaveFile(SomeStream, RichTextBoxStreamType) I think StreamWriter is stuffing it up. Oh and seeing as you just gave the world the keys for your encryption you might want to come up with a new one... Added after comment not proven though. Replace these two lines in your save routine Dim sWriter As New StreamWriter(cStream) sWriter.WriteLine(RichTextBox1.Rtf) with RichTextBox1.SaveFile(cStream,RichTextBoxStreamType.RichText); and get rid of swriter.Close() I think.

Categories : Vb.Net

how do I use .split on formatted text
Its because your strings are not seperated uniformly with single spaces. They may have double or triple spaces in between. A modified version splitting on 3 spaces: http://jsfiddle.net/zT38R/6/ var arrayOfLines = document.getElementById("fltInput").value.split(' '); console.log(arrayOfLines); var arrayOfWords = arrayOfLines[1].split(" ");// changed here Either format your input correctly. Or better use regex based parsing of data.

Categories : Javascript

Button to open text file won't function with text file not in class root directory
This is windows specific code, I think the problem is using the file separator "/" instad of "", try changing your code to Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + "config\gameItems.txt");

Categories : Java

how to get userinput formatted text from mysql
You might need the following code for displaying. // $notice_area assumes you have database query and the reuslt is correctly fetched. echo str_replace("\r\n","<br/>", (htmlspecialchars(($notice_area)))); Why? http://php.net/manual/en/function.mysql-real-escape-string.php mysql_real_escape_string() will add slashes prior to , , so on. after inserting into db then are then in plain text because you added them by \n and \r. so after getting the plain text of and , you need to replace them with , then it is it :D

Categories : PHP

Html display formatted text
Wrap your text inside the <pre> tag. JSFiddle <pre> +-001 This is a Line 00:12:04 002 ---------------------------------- - 003 Everthing looks good so far ------ </pre>

Categories : HTML

how can i have a text field which have text in it and when the user clicks on the text field the text inside the field vanishes
You should use attrs parameter for form field widget like this: from django.forms import TextInput class CategoriesForm(ModelForm): class Meta: model = Categories widgets = { 'category_name': TextInput(attrs={'placeholder': 'PLACEHOLDER TEXT HERE'}) } Here is documentation

Categories : Python

Convert range formatted as date to text
Here's something that I posted on my blog. It uses a loop in one direction, but should be a lot faster than your loop attempts. It uses a trick of Selecting a new cell every so often, to account for this bug described by Charles Williams. Sub NumberToStringWithFormat(rng As Excel.Range) Dim Texts() As String Dim i As Long, j As Long 'This might prevent "###" if column too narrow rng.EntireColumn.AutoFit 'Can't use variables in Dim ReDim Texts(1 To rng.Rows.Count, 1 To rng.Columns.Count) For i = 1 To rng.Rows.Count 'Charles Williams' fix for slow code with Text If i Mod 1000 = 0 Then rng.Range("A1").Offset(i).Select End If For j = 1 To rng.Columns.Count Texts(i, j) = rng.Cells(i, j).Text Next j Next i '@ is the Text format rng.NumberFormat = "@" rng.Valu

Categories : Excel

saving formatted text in mysql database
strip_tags is used to strip html/php tags from a value. I would guess that the WYSIWYG editor you use outputs html data, so by using the strip_tags function you are canceling the formatting. UPDATE: when you bind a parameter to a query through pdo it escapes the inserted data. when inserting the data apply htmlspecialchars($value, ENT_QUOTES) and when displaying the data apply htmlspecialchars_decode($value, ENT_QUOTES)

Categories : PHP

Reading a formatted text file in java
Use the below code to format the string in java import java.util.StringTokenizer; public class Test { public static void main(String args[]) { String str="0:1 0:0 1:1 2:2 3:3"; format(str); } public static void format(String str) { StringTokenizer tokens=new StringTokenizer(str, " "); // Use Space as a Token while(tokens.hasMoreTokens()) { String token=tokens.nextToken(); String[] splitWithColon=token.split(":"); System.out.println(splitWithColon[0] +" "+splitWithColon[1]); } } } Output of Code : 0 1 0 0 1 1 2 2 3 3

Categories : Java

Display only formatted text from mysql database
$('#assignment').innerHTML(assignment); //wrong It should be like .text(), set the text contents of the matched elements. $('#assignment').text(assignment); or the .html() function can take strings of HTML, and will effectively modify the .innerHTML property. $('#assignment').html(assignment);

Categories : Javascript

Rails: How to save formatted text in text_area?
There are many ways to handle this. When displaying text previously inputed in text area you can: replace newline characters with <br/> tags use <pre> tag and display text inside that tag split text by newline characters and then wrap each of the chunks into <p> tags When using approach 1 or 3, make sure to pass text through raw helper, so that any tags within text are displayed. Be aware though, that user may pass arbitrary html inside the textarea, hence your code may be subject to xss attacks.

Categories : Ruby On Rails

c# visual studio - Better tool to use with formatted text
Check out AvalonEdit from SharpDevelop project. It has declarative formatting with 'out-of-the-box' support for many languages. And it can control any formatting by code as well. https://github.com/icsharpcode/SharpDevelop/wiki/AvalonEdit http://www.codeproject.com/Articles/42490/Using-AvalonEdit-WPF-Text-Editor And it's even available in NuGet https://www.nuget.org/packages/AvalonEdit

Categories : C#

Storing formatted text from tinymce in database
I use the below function so you would need to convert your mysql to mysqli ... which you need to do anyhow or you code will not work with upcoming releases. LINK to help http://php.net/manual/en/mysqli.query.php Also note this code it modified as I have it in classes so it might be a little off ... I don't use global etc etc. function escapeString($string) { global $connection; // depreciated function if (version_compare(phpversion(),"4.3.0", "<")){ return mysqli_escape_string($connection, $string); } else { return mysqli_real_escape_string($connection, $string); } } $sql = "INSERT INTO Emails (date, subject, greeting, results, upcoming, thisweek, signoff) VALUES ('" . escapeString($today) . "', '" . escapeS

Categories : PHP

Obj-C: Convert INT to text formatted as "sixth" or "twenty-third"
I think what you might be thinking of is ordinal numbers. Try these libraries out: TTTOrdinalNumberFormatter FormatterKit (Which includes TTTOrdinalNumberFormatter) Also reference this SO post: Objective-C: format numbers to ordinals: 1, 2, 3, .. to 1st, 2nd, 3rd

Categories : Objective C

How to parse and read Json formatted text?
Make a class that matches and then use a Deserializer. This is using the System.Web.Script.Serialization namespace. public class Item { public int Id { get; set; } public int MsgId { get; set; } public string ExceptionDetails { get; set; } } public class RootObject { public List<Item> Items { get; set; } public RootObject DeserializeClass() { JavaScriptSerializer serializer = new JavaScriptSerializer(); RootObject obj = serializer.Deserialize<RootObject >(JSONSTRING); return obj; } }

Categories : C#

String is not formatted accordingly after I load it from a text file
The escape sequences using the backslash are parsed and translated to the appropriate character code at compile time not runtime. In order for this to work you will need to process the string and replace the escape sequences yourself after you have loaded it from the file. The example below shows a simple way to do this. #include <iostream> #include <string> void replace_needle( std::string &haystack, const std::string& needle, const std::string& with) { std::string::size_type pos; while((pos = haystack.find(needle)) != std::string::npos) { haystack.replace(pos, needle.size(), with); } } int main() { // use double backslashes to simulate the exact string read from the file std::string str = "This is first line\r\nThis i

Categories : C++

How to set text formatted in Android Studio in ubuntu
Hey Now I have your answer. You need to change Ubuntu key shortcuts for Lock Screen For this. Go to System Tools -> System Settings -> Keyboard -> Shortcuts Tab -> System -> Lock Screen Select the row New Accelerator... will be visible then press any Special key with Alpha key (like Shift + L). You changed the key shortcuts. Now check format key in Studio.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.