Search Results

Search found 256 results on 11 pages for 'multiline'.

Page 6/11 | < Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Validating the SharePoint InputFormTextBox / RichText Editor using JavaScript

    - by Jignesh Gangajaliya
    In the previous post I mentioned about manipulating SharePoint PeoplePicker control using JavaScript, in this post I will explain how to validate the InputFormTextBox contol using JavaScript. Here is the nice post by Becky Isserman on why not to use RequiredFieldValdator or InputFormRequiredFieldValidator with InputFormTextbox. function ValidateComments() {     //retrieve the text from rich text editor.     var text = RTE_GetRichEditTextOnly("<%= rteComments.ClientID %>");     if (text != "")     {         return true;     }     else     {         alert('Please enter your comments.');         //set focus back to the rich text editor.         RTE_GiveEditorFocus("<%= rteComments.ClientID %>");         return false;     }     return true; } <SharePoint:InputFormTextBox ID="rteComments" runat="server" RichText="true" RichTextMode="Compatible" Rows="10" TextMode="MultiLine" CausesValidation="true" ></SharePoint:InputFormTextBox> <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" OnClientClick="return ValidateComments()" CausesValidation="true" /> - Jignesh

    Read the article

  • ASP.NET Web Forms Extensibility: Control Adapters

    - by Ricardo Peres
    All ASP.NET controls from version 2.0 can be associated with a control adapter. A control adapter is a class that inherits from ControlAdapter and it has the chance to interact with the control(s) it is targeting so as to change some of its properties or alter its output. I talked about control adapters before and they really a cool feature. The ControlAdapter class exposes virtual methods for some well known lifecycle events, OnInit, OnLoad, OnPreRender and OnUnload that closely match their Control counterparts, but are fired before them. Because the control adapter has a reference to its target Control, it can cast it to its concrete class and do something with it before its lifecycle events are actually fired. The adapter is also notified before the control is rendered (BeginRender), after their children are renderes (RenderChildren) and after itself is rendered (Render): this way the adapter can modify the control’s output. Control adapters may be specified for any class inheriting from Control, including abstract classes, web server controls and even pages. You can, for example, specify a control adapter for the WebControl and UserControl classes, but, curiously, not for Control itself. When specifying a control adapter for a page, it must inherit from PageAdapter instead of ControlAdapter. The adapter for a control, if specified, can be found on the protected Adapter property, and for a page, on the PageAdapter property. The first use of control adapters that came to my attention was for changing the output of standard ASP.NET web controls so that they were more based on CSS and less on HTML tables: it was the CSS Friendly Control Adapters project, now available at http://code.google.com/p/aspnetcontroladapters/. They are interesting because you specify them in one location and they apply anywhere a control of the target type is created. Mind you, it applies to controls declared on markup as well as controls created by code with the new operator. So, how do you use control adapters? The most usual way is through a browser definition file. In it, you specify a set of control adapters and their target controls, for a given browser. This browser definition file is a XML file with extension .Browser, and can either be global (%WINDIR%\Microsoft.NET\Framework64\vXXXX\Config\Browsers) or local to the web application, in which case, it must be placed inside the App_Browsers folder at the root of the web site. It looks like this: 1: <browsers> 2: <browser refID="Default"> 3: <controlAdapters> 4: <adapter controlType="System.Web.UI.WebControls.TextBox" adapterType="MyNamespace.TextBoxAdapter, MyAssembly" /> 5: </controlAdapters> 6: </browser> 7: </browsers> A browser definition file targets a specific browser, so you can have different definitions for Chrome, IE, Firefox, Opera, as well as for specific version of each of those (like IE8, Firefox3). Alternatively, if you set the target to Default, it will apply to all. The reason to pick a specific browser and version might be, for example, in order to circumvent some limitation present in that specific version, so that on markup you don’t need to be concerned with that. Another option is through the the current Browser object of the request: 1: this.Context.Request.Browser.Adapters.Add(typeof(TextBox).FullName, typeof(TextBoxAdapter).FullName); This must go very early on the page lifecycle, for example, on the OnPreInit event, or even on Application_Start. You have to specify the full class name for both the target control and the adapter. Of course, you have to do this for every request, because it won’t be persisted. As an example, you may know that the classic TextBox control renders an HTML input tag if its TextMode is set to SingleLine and a textarea if set to MultiLine. Because the textarea has no notion of maximum length, unlike the input, something must be done in order to enforce this. Here’s a simple suggestion: 1: public class TextBoxControlAdapter : ControlAdapter 2: { 3: protected TextBox Target 4: { 5: get 6: { 7: return (this.Control as TextBox); 8: } 9: } 10:  11: protected override void OnLoad(EventArgs e) 12: { 13: if ((this.Target.MaxLength > 0) && (this.Target.TextMode == TextBoxMode.MultiLine)) 14: { 15: if (this.Target.Page.ClientScript.IsClientScriptBlockRegistered("TextBox_KeyUp") == false) 16: { 17: if (this.Target.Page.ClientScript.IsClientScriptBlockRegistered(this.Target.Page.GetType(), "TextBox_KeyUp") == false) 18: { 19: String script = String.Concat("function TextBox_KeyUp(sender) { if (sender.value.length > ", this.Target.MaxLength, ") { sender.value = sender.value.substr(0, ", this.Target.MaxLength, "); } }\n"); 20:  21: this.Target.Page.ClientScript.RegisterClientScriptBlock(this.Target.Page.GetType(), "TextBox_KeyUp", script, true); 22: } 23:  24: this.Target.Attributes["onkeyup"] = "TextBox_KeyUp(this)"; 25: } 26: } 27: 28: base.OnLoad(e); 29: } 30: } What it does is, for every TextBox control, if it is set for multi line and has a defined maximum length, it injects some JavaScript that will filter out any content that exceeds this maximum length. This will occur for any TextBox that you may have on your site, or any class that inherits from it. You can use any of the previous options to register this adapter. Stay tuned for more ASP.NET Web Forms extensibility tips!

    Read the article

  • Making your ASP.NET/HTML Websites Indic aware &ndash; accepting Tamil, Telugu, Kannada, Hindi and ot

    - by Harish Ranganathan
    Its been a month since I wrote my last post.  Much of work has been happening around planning for Tech Ed India, the upcoming Virtual TechDays this week as well as our Developer content at the Great Indian Developer Summit 2010.  Its going to be one exciting period starting this week and I am glad I would be able to meet a lot of folks who have written to me personally that they would like to catch up at Tech Ed India. For now, I had a chance to meet the Microsoft India Development Centre team that worked on the Microsoft Indic Language Input Tool (erstwhile Akshara). The team updated me that they have also released the scripts  so that the Indic input feature can be encapsulated into your own websites.  For example, if you are having a web page where you collect user information, you can pretty much make your site indic aware i.e. accept inputs in Tamil, Telugu, Kannada, Hindi etc.,  All you would need to include would be a bunch of scripts onto your web pages and you are ready to make it, like I said, “indic aware” I have built a sample web page that accepts First Name, Last Name, Address and an additional field.  When it comes to accepting indic, sometimes, you may want to avoid the indic input in certain fields and accept it in English.  You can specify the MicrosoftILITWebAttach="false" attribute to the Text Boxes and Text Areas (TextMode=”Multiline” in ASP.NET) so that the particular field automatically switches over to English input.  Similarly, the moment you specify that the TextMode=”Password” to make it as a password field, it automatically ignores all indic recognition and shows the masked dots for the words entered. Note that, this is, when we are going for the Opt-out mode, where we are specifying that by default all the input controls would need indic awareness and we would specify for those controls where it is not required.  The other mode is Opt-in mode where you would need to add a different property to the script definition i.e. attachMode=”optin” .  When we do this, we need to explicitly add the MicrosoftILITWebAttach="true" attribute for every control where we need indic input. I have created a sample web page which accepts First Name, Last Name, Address and an additional input field to demonstrate the “Opt-out”.   You can copy paste this into any of your web pages to check it <form id="form1" runat="server">     <!-- Microsoft Indic Language Input Tool embed code --> <input type="hidden" id="MicrosoftILITWebEmbedInfo" attachMode="optout" value="" /> <script type="text/javascript" src="http://ilit.microsoft.com/bookmarklet/script/Tamil.js" defer="defer"></script>     <div>     <h2>         Welcome to the Registration Page     </h2>     <p>         First Name: <asp:TextBox runat="server" ID="txtFirstName" />         <br />         <br />         Last Name: <asp:TextBox runat="server" ID="txtLastName" />         <br />         <br />         Password:         <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" />         <br />         <br />         Address: <asp:TextBox runat="server" ID="txtAddress" TextMode="MultiLine" Height="100" Width="200" />         <br />         <br />         English Text: <asp:TextBox ID="txtEnglishText" runat="server" MicrosoftILITWebAttach="false" />     </p>     <p>         <!-- Microsoft Indic Language Input Tool attribution image link --> <a style="text-decoration: none" href="http://go.microsoft.com/fwlink/?LinkID=184205&clcid=0x409"><img style="border: 0px" alt="Transliteration by Microsoft" src="http://ilit.microsoft.com/bookmarklet/images/attribution.png"></a>     </p>     </div>     </form> If you note the code snippet above, I have included the scripts in the top with the attachMode set to “optout” and for the last TextBox, I have mentioned the MicrosoftILITWebAttach="false” attribute to make it accept English input.   Additionally, you also need to add the “Microsoft Indic Language Input Tool attribution image” to your web page as a courtesy to the team that developed this feature.  It would basically add a image saying “Transliteration by Microsoft” similar to a Copy Right image.  You can see the screen shot below where I have typed it in Tamil.  In that you will notice that the password field behaves as expected and the last field accepts English Text.  You can also notice the icon that comes in the first textbox that indicates that, the field is going to accept indic text.   This sample is using Tamil, but you can pretty much do it for Hindi, Telugu, Kannada, Marathi, Bengali etc.,   The website for getting the Indic script and other instructions is http://specials.msn.co.in/ilit/WebEmbed.aspx?language=Tamil You can replace the querystring value “Tamil” to other languages as mentioned above to get the respective script. This also works for plain HTML based websites and doesn’t necessarily need you to use ASP.NET to achieve the functionality. Note that, this form is not completely localized.  This is transliterated.  You can add label controls for FirstName, LastName indication etc., and use the Visual Studio tools to localize and get those values from resource files.  In the resource files, you can enter the text in different languages to make this a truly localized page.  If you just want to download the Indic Tool Desktop version (that can be used for typing in Word, Excel, pretty much any input area), you can download it from http://specials.msn.co.in/ilit/  In the same page, there is also a web version where you can type and get text then and there if you dont want to install the desktop version. So, go ahead, download / use them in your websites and enjoy the power of Indic. Cheers !!!

    Read the article

  • Sharepoint InputFormTextBox not working on updatepanel?

    - by James123
    I have two panels in update panel. In panel1, there is button. If I click, Panel1 will be visible =false and Panel2 will be visible=true. In Panel2, I placed SharePoint:InPutFormTextBox. It not rendering HTML toolbar and showing like below image. <SharePoint:InputFormTextBox runat="server" ID="txtSummary" ValidationGroup="CreateCase" Rows="8" Columns="80" RichText="true" RichTextMode="Compatible" AllowHyperlink="true" TextMode="MultiLine" /> http://i700.photobucket.com/albums/ww5/vsrikanth/careersummary-1.jpg

    Read the article

  • Objective-C: How to replace HTML entities?

    - by arielcamus
    Hi, I'm getting text from Internet and it contains html entities (i.e. &oacute; = ó). I want to show this text into a custom iPhone cell. I've tried to use a UIWebView into my custom cell but I prefer to use a multiline UILabel. The problem is I can't find any way of replacing these HTML entities.

    Read the article

  • WYSIWYG editor in Palm WebOS

    - by Mikhail
    Does anyone know how to embed WYSIWYG editor in multiline TextField? I need rather complex editor such as TinyMCE, but I can't get it working with Mojo widgets. Maybe, I'm doing something wrong? If there's a way to do it, please, give me some pointers! Thanks in advance, Mikhail.

    Read the article

  • java Regular expression matching html

    - by user121196
    I want to match and capture the enclosing content of the <pre></pre> tag tried the following, not working, what's wrong? String p="<pre>.*</pre>"; Matcher m=Pattern.compile(p,Pattern.MULTILINE|Pattern.CASE_INSENSITIVE).matcher(input); if(m.find()){ String g=m.group(0); System.out.println("g is "+g); }

    Read the article

  • Allow users to insert a TAB into a TextBox but not newlines

    - by pbean
    I want to have a TextBox which does accept the TAB key (and places a TAB, ASCII 0x09, \t accordingly into the textbox) instead of jumping to the next control. The TextBox has a property AcceptsTab, which I have set to true but this does not give the desired result. It turns out the AcceptsTab property only works then Multiline is set to true as well. However I want to have a one-line TextBox which doesn't accept newlines.

    Read the article

  • can create a new thread on goog-app-engine ..(python)

    - by zjm1126
    i use this code can crteate ,but someone say it can't create ,why ? class LogText(db.Model): content = db.StringProperty(multiline=True) class MyThread(threading.Thread): def __init__(self,threadname): threading.Thread.__init__(self, name=threadname) def run(self,request): log=LogText() log.content=request.POST.get('content',None) log.put() def Log(request): thr = MyThread('haha') thr.run(request) return HttpResponse('')

    Read the article

  • Java Swt Text (SWT.MULTI) append text without scroll

    - by mchr
    I have a Java SWT GUI with a multiline Text control. I want to append lines of text to the Text control without affecting the position of the cursor within the text box. In particular, the user should be able to scroll and select text at the top of the Text control while new text lines are appended to the bottom. Is this possible?

    Read the article

  • How to use scroll view on iPhone?

    - by iPhoney
    I want to display a text with a lot of lines. I added a multiline-label to a scroll view, but it didn't show anything. Looks like this is not the correct way to use the scroll view. How to use scroll view so that users can drag down to see more text?

    Read the article

  • JSON serialization of Google App Engine models

    - by user111677
    I've been search for quite a while with no success. My project isn't using Django, is there a simple way to serialize App Engine models (google.appengine.ext.db.Model) into JSON or do I need to write my own serializer? My model class is fairly simple. For instance: class Photo(db.Model): filename = db.StringProperty() title = db.StringProperty() description = db.StringProperty(multiline=True) date_taken = db.DateTimeProperty() date_uploaded = db.DateTimeProperty(auto_now_add=True) album = db.ReferenceProperty(Album, collection_name='photo') Thanks in advance.

    Read the article

  • Mulitple lines in make

    - by Navi
    I am trying to store a multiline string in a variable in make var=$(shell cat <<End-of-message \ -------------------------------------\ This is line 1 of the message.\ This is line 2 of the message.\ This is line 3 of the message.\ This is line 4 of the message.\ This is the last line of the message.\ -------------------------------------\ End-of-message) printit: @echo ${var} This doesn't work, so I am wondering if this is possible at all. I need to preserve the newlines here and shell is converting them in spaces. Any suggestions?

    Read the article

  • Delete all characters in a multline string upto a given pattern

    - by biffabacon
    Using Python I need to delete all charaters in a multiline string up to the first occurrence of a given pattern. In Perl this can be done using regular expressions with something like: #remove all chars up to first occurrence of cat or dog or rat $pattern = 'cat|dog|rat' $pagetext =~ s/(.*)($pattern)/$2/xms; What's the best way to do it in Python?

    Read the article

  • Delete all characters in a multline string up to a given pattern

    - by biffabacon
    Using Python I need to delete all charaters in a multiline string up to the first occurrence of a given pattern. In Perl this can be done using regular expressions with something like: #remove all chars up to first occurrence of cat or dog or rat $pattern = 'cat|dog|rat' $pagetext =~ s/(.*?)($pattern)/$2/xms; What's the best way to do it in Python?

    Read the article

  • how to send some data to the Thread module on python and google-map-engine

    - by zjm1126
    from google.appengine.ext import db class Log(db.Model): content = db.StringProperty(multiline=True) class MyThread(threading.Thread): def run(self,request): #logs_query = Log.all().order('-date') #logs = logs_query.fetch(3) log=Log() log.content=request.POST.get('content',None) log.put() def Log(request): thr = MyThread() thr.start(request) return HttpResponse('') error is : Exception in thread Thread-1: Traceback (most recent call last): File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner self.run() File "D:\zjm_code\helloworld\views.py", line 33, in run log.content=request.POST.get('content',None) NameError: global name 'request' is not defined

    Read the article

  • Filtering python string through external program

    - by Peter
    What's the cleanest way of filtering a Python string through an external program? In particular, how do you write the following function? def filter_through(s, ext_cmd): # Filters string s through ext_cmd, and returns the result. # Example usage: # filter a multiline string through tac to reverse the order. filter_through("one\ntwo\nthree\n", "tac") # => returns "three\ntwo\none\n" Note: the example is only that - I realize there are much better ways of reversing lines in python.

    Read the article

  • Display url in text box

    - by xrx215
    I have a textbox as follows: <asp:TextBox runat="server" ID="txtOtherApps" Height="400" Width="400" TextMode="MultiLine" ontextchanged="txtOtherApps_TextChanged" ></asp:TextBox> How to display link in this textbox?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >