Search Results

Search found 5222 results on 209 pages for 'characters'.

Page 120/209 | < Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >

  • ASP.Net - How do I allow users to enter html tags in textbox without runtime errors?

    - by Coder
    I have an input textbox on an asp.net page and when a user inputs any tags like break tags or bold an error occurs. I currently am using the following to encode the input: Server.HtmlEncode(mytextbox.Text) However this only encodes characters when they aren't phrased as an html tag, like if the input is "<<<" is there a way for me to allow the user to put the tags in without it leading to a runtime error? Thanks.

    Read the article

  • How do you make a regular expression that matches a word with one randomly inserted character?

    - by Dfowj
    Hey all, i want to use a regular expression to match a word with one specified character randomly placed within it. I also want to keep that 'base' word's characters in their original order. For example, with the 'base' word of test and the specified character of 'y', i want the regular expression to match all the following, and ONLY the following: ytest, tyest, teyst, tesyt, testy Incase it matters, im working in javascript and using the dojo toolkit. Thanks!

    Read the article

  • Regular expression Not working properly n case of multiple trailing ]]]]

    - by ronan
    I have the requirement that in a textbox a user can jump to the next word enclosed in [] on a tab out for example Hi [this] is [an] example. Testing [this] So when my cursor is at Hi and I do a tab out , the characters enclosed in the [this] are highlighted and when I again do a tabl out th next characters enclosed in following [an] are highlighted. This works fine Now the requirement is whatever the text including the special chars between [] needs to be highlighted case 1: when I have trailing ]]], it only highlights leading [[[ and ignores ]]]] e.g case 2: In case of multiple trailing ] e.e [this]]]] is [test], ideally one a single tabl out from this , it should go to next text enclosed in [] but a user has to tab out 4 times one tab per training ] to go to next [text] strong text The code is $(document).ready(function() { $('textarea').highlightTextarea({ color : '#0475D1', words : [ "/(\[.*?\])/g" ], textColor : '#000000' }); $('textarea').live('keydown', function(e) { var keyCode = e.keyCode || e.which; if (keyCode == 9) { var currentIndex = getCaret($(this).get(0)) selectText($(this), currentIndex); return false; } }); }); function selectText(element, currentIndex) { var rSearchTerm = new RegExp(/(\[.*?\])/); var ind = element.val().substr(currentIndex).search(rSearchTerm) currentIndex = (ind == -1 ? 0 : currentIndex); ind = (ind == -1 ? element.val().search(rSearchTerm) : ind); currentIndex = (ind == -1 ? 0 : currentIndex); var lasInd = (element.val().substr(currentIndex).search(rSearchTerm) == -1 ? 0 : element.val().substr(currentIndex).indexOf(']')); var input = element.get(0); if (input.setSelectionRange) { input.focus(); input.setSelectionRange(ind + currentIndex, lasInd + 1 + currentIndex); } else if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', lasInd + 1 + currentIndex); range.moveStart('character', ind + currentIndex); range.select(); } } function getCaret(el) { if (el.selectionEnd) { return el.selectionEnd; } else if (document.selection) { el.focus(); var r = document.selection.createRange(); if (r == null) { return 0; } var re = el.createTextRange(), rc = re.duplicate(); re.moveToBookmark(r.getBookmark()); rc.setEndPoint('EndToStart', re); return rc.text.length; } return 0; } Please let me know to handle two above cases

    Read the article

  • How to use ';' in urls, using Google Appengine

    - by tonfa
    Using the local dev server, I can use ';' in urls, but as soon as I try the live version hosted by Google, it looks like the ';' and everything afterward is stripped (at least according to request.path_qs). (I would prefer not to encode them if possible, it's much less user friendly if the url cannot be constructed by copy-pasting, especially since other characters works fine, e.g. ':').

    Read the article

  • Write string to fixed-length byte array in C#

    - by toasteroven
    somehow couldn't find this with a google search, but I feel like it has to be simple...I need to convert a string to a fixed-length byte array, e.g. write "asdf" to a byte[20] array. the data is being sent over the network to a c++ app that expects a fixed-length field, and it works fine if I use a BinaryWriter and write the characters one by one, and pad it by writing '\0' an appropriate number of times. is there a more appropriate way to do this?

    Read the article

  • .NET - alpha-numeric representation of numbers

    - by mack369
    I'm implementing serial key functionality in my application. User needs to enter at least 64bit number in order to register the application. Because typing number like 9,223,372,036,854,775,807 will take a while I want to compress it a bit. The first guess was to code this number hexadecimally but it still is quite long (0x7FFF FFFF FFFF FFFF). Is there any standard method in .NET to code this number alphanumerically using for example: digits, upper-case and lower-case characters?

    Read the article

  • How to allow utf-8 charset in preg_match ???

    - by Shri.harry
    Hello everone, I am using preg_match() function only to allow specific charachters to accept. It is allowing all alphabates and numbers but along with that i also want to allow utf-8 characters such as "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ" so how can i allow this charachters from preg_match() function.Plase suggest me. Thanks in advance. Regards Shri

    Read the article

  • htaccess Rewriterule to make one query part of another

    - by Dan T
    I have a url /embed?t=X and I want to redirect it to /page/embed/X where X is any number of alpha numeric characters. I know must redirect rules go the other way but for the purpose of the applciation I need to reverse it. Any ideas? I have tried things like: RedirectRule ^embed\?t\=([a-zA-Z0-9]+)$ /page/embed/$1 but with no luck.

    Read the article

  • Encoding in SQL to CSV

    - by Z77
    When do I execute query COPY TO ... CSV, I create CSV file. BUt when open it column with names in excel that should be with national characters are not as it should be. So my question is, If it is possible within a sql query to change this encoding to utf8? Or something else? Because I want that new created CSV file to be as final product for user on web. I hope someone understood what I want:)

    Read the article

  • How to keep same substrings in vim regex

    - by invisiblerhino
    Hi everyone. I'd ideally like a vim answer to this: I want to change [*, 1, *, *] to [*, 2, *, *] Here the stars refer to individual characters in the substring, which I would like to keep unchanged. For example [0, 1, 0, 1] to [0, 2, 0, 1] [1, 1, 1, 1] to [1, 2, 1, 1] If people know how to do this in perl or python or whatever, that would be equally good. Cheers

    Read the article

  • C++ Logger-Should I use an ordinary xml parser?

    - by Jonathon
    I'm working on a logging system for my 2D engine, and I'm confused on how I should go about creating/editing the file, and how I should output that file. I've learned that XML is more of a data carrier rather than a data displayer like HTML is. I've read that I can use XML to HTML converters. One method I've thought about is writing characters to a file in HTML. Clarity on these matters is what I ask of you, stack overflow.

    Read the article

  • Find all possible starting positions of a regular expression match in perl, including overlapping matches?

    - by jonderry
    Is there a way to find all possible start positions for a regex match in perl? For example, if your regex was "aa" and the text was "aaaa", it would return 0, 1, and 2, instead of, say 0 and 2. Obviously, you could just do something like return the first match, and then delete all characters up to and including that starting character, and perform another search, but I'm hoping for something more efficient.

    Read the article

  • Why does visual studio think js file is a cs file?

    - by divitiae
    I have a ASP.NET solution in Visual Studio 2008 and I added a file identical to http://plugins.jquery.com/files/jquery.cookie.js.txt named jquery.cookie.js in a subfolder of my project containing other javascript files and Visual Studio is treating it as a C# file, giving me errors like CS1012: Too many characters in character literal and Semicolon after method or accesssor block is not valid. Why?

    Read the article

  • Go - Data types for validation

    - by nevalu
    How to create a new data type for Go which to can check/validate its schema when is created a new variable (of that type)? By example, to validate if a string has 20 characters, I tried: // Format: 2006-01-12T06:06:06Z func date(str string) { if len(str) != 20 { fmt.Println("error") } } var Date = date() type Account struct { domain string username string created Date } but it fails because Date is not a type.

    Read the article

  • JavaScript: A BackSlash as part of the string

    - by Abs
    Hello all, I have a JavaScript variable that I echo out using PHP which is shown like this in the page source: var db_1 = 'C:\this\path'; When I set the value of a text field with that variable like so: $('#myinput').val(db_1); The slashes have disappeared and only the other characters are left! Why is this and how can I put the slashes back in?? Thanks all

    Read the article

  • trim a string in jquery

    - by amit
    i need to trim a string to its first 100 characters using jquery/javascript. also is it possible to scan a string and look for a particular combination of keywords such as #key? thanks a lot for the help.

    Read the article

  • Entity framework 4 many-to-many insertion?

    - by Saxman
    Hi all, I'm not very familiar with the many-to-many insertion process using Entity Framework 4, POCO. I have a blog with 3 tables: Post, Comment, and Tag. A Post can have many Tags and a Tag can be in many Posts. Here are the Post and Tag models: public class Tag { public int Id { get; set; } [Required] [StringLength(25, ErrorMessage = "Tag name can't exceed 25 characters.")] public string Name { get; set; } public virtual ICollection<Post> Posts { get; set; } } public class Post { public int Id { get; set; } [Required] [StringLength(512, ErrorMessage = "Title can't exceed 512 characters")] public string Title { get; set; } [Required] [AllowHtml] public string Content { get; set; } public string FriendlyUrl { get; set; } public DateTime PostedDate { get; set; } public bool IsActive { get; set; } public virtual ICollection<Comment> Comments { get; set; } public virtual ICollection<Tag> Tags { get; set; } } Now when I'm adding a new post, I'm not sure what would be the right way to do. I'm thinking that I'll have a textbox where I can select multiple tags for that post (this part is already done), in my controller, I will check to see if the tag is already exists or not, if not, then I will insert the new tag. But I'm not even sure based on the models that I've created for EF, will they create a PostsTags table, or they are creating just a Tags and a Posts table and links between the two? How would I insert the new Post and set the tags to that post? Is it just newPost.Tags = Tags (where Tags are the one that got selected, do I even need to check to see if they already exists?), and then something like _post.Add(newPost);? Thanks.

    Read the article

  • matrices&searching [closed]

    - by gcc
    question 1) between different characters&real numbers , finding specific one how could i do question 2) myfriend asked me a good question : can we divide two matrices to each other // in math , we havenot learned but maybe someone knows where we find the answer

    Read the article

< Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >