Search Results

Search found 47079 results on 1884 pages for 'input method kit'.

Page 14/1884 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • masked input: I can't get the simplest completion to work

    - by Karl Messner
    Trying to use Josh Bush's masked input plugin. I want to shift focus and do other things once the person puts their cell phone in. I mask to a phone shape. When I hit the last letter, I want it to trigger a javascript function. Right now that function just alerts hi. But I can't get it to work: function jump(){ alert('hi'); } $(document).ready(function(){ $("#cellphone").focus(); jQuery(function($){ $("#product").mask("(999) 999-9999",{completed:function(){jump();}}); }); });

    Read the article

  • Batch File input validation - Make sure user entered an integer

    - by B2Ben
    I'm experimenting with a DOS batch file to perform a simple operation which requires the user to enter a non-negative integer. I'm using simple batch-file techniques to get user input: @ECHO OFF SET /P UserInput=Please Enter a Number: The user can enter any text they want here, so I would like to add some routine to make sure what the user entered was a valid number. That is... they entered at least one character, and every character is a number from 0 to 9. I'd like something I can feed the UserInput into. At the end of the routine would be like an if/then that would run different statements based on whether or not it was actually a valid number. I've experimented with loops and substrings and such, but my knowledge and understanding is still slim... so any help would be appreciated. I could build an executable, and I know there are nicer ways to do things than batch files, but at least for this task I'm trying to keep it simple by using a batch file.

    Read the article

  • How to read formatted input in python?

    - by eSKay
    I want to read from stdin five numbers entered as follows: 3, 4, 5, 1, 8 into seperate variables a,b,c,d & e. How do I do this in python? I tried this: import string a=input() b=a.split(', ') for two integers, but it does not work. I get: Traceback (most recent call last): File "C:\Users\Desktop\comb.py", line 3, in <module> b=a.split(', ') AttributeError: 'tuple' object has no attribute 'split' How to do this? and suppose I have not a fixed but a variable number n integers. Then?

    Read the article

  • Tracking graphics tablet input in C#

    - by Martin
    I'm writing an XNA application with C#, and I want to be able to control the application with a graphics tablet. All I need to be able to do is track the position and pressure of the pen on the tablet, it would be nice to have some built in gesture recognition but I'm willing to build that myself if needed. My first attempt at this was to use the vbtablet library. However, when I sent this to a friend it failed to work. It seems that the underlying technology is quite old and not supported by some tablets. My second attempt is to play with the Microsoft.Ink system. This looks promising, but I know very little about this subject and I'm struggling to make it work properly - for example I can't find how to read the raw tablet input and disable mouse pointer mode on the tablet when using an InkOverlay. What's the best system to use and what good documentation is there for a beginner in this field?

    Read the article

  • Default Values in XForms Input

    - by Josh
    I have an XForm that has certain fields that may often be left blank (optional street address). Is there is technique to set a default value for that field, preferably a space (I am running into weird formatting issues with CSS). The html form way of value="" doesn't work, neither does setting a default value in the XML schema. EXAMPLE: <xforms:input ref="clientaddress/streetaddress2" model="model_inventory" > <xforms:label>Street Address (Line 2)</xforms:label> Leaving this field blank results in <streetaddress2/> in the resulting xml document I want <streetaddress> </streetaddress>

    Read the article

  • How can i take only integer input from keyboard and if input is invalid how do i ask user agaian

    - by fari
    This is what i have written so far but when exception is raised it does not again ask teh user for input. do{ System.out.println("Enter the number of stones to play with: "); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String temp=br.readLine(); }while (key<0 && key>9); if(key<0 || key>10) throw new InvalidStartingStonesException(key); player1=new KeyBoardPlayer(); player2 = new KeyBoardPlayer(); this.player1=player1; this.player2=player2; state=new KalaGameState(key); } catch(NumberFormatException nFE) { System.out.println("Not an Integer");} catch(IOException e) { System.out.println(e); }

    Read the article

  • Best Practice - Validating Input In Simple GUI Application?

    - by Alex
    I'm writing a GUI app with wxwidgets in C++ for one of my programming classes. We have to validate input and throw custom exceptions if it doesn't meet certain conditions. My question is, what is best practice when it comes to this? Should I write a seperate function that checks for errors, and have my event handler's call that function? Or should I do my error-checking in my event handlers? Or does it really matter? Thanks!

    Read the article

  • C++ input chaining in C#

    - by Monty
    I am trying to learn C# coming from C++. I am writing just some basic console stuff to get a feel for it and was wondering if it is possible to do simple chaining of inputs in C#. For example in C++: cout<<"Enter two numbers: "; cin >> int1 >> int2; You could then just input 3 5 and hit enter and the values will be fine. In C# however I have to split it up(as far as I can tell) like this: Console.Write("Enter the first number: "; int1 = (char)Console.Read(); Console.Writeline(""); Console.Write("Enter the second number: "; int2 = (char)Console.Read(); Maybe I am just missing something.

    Read the article

  • jQuery Date Picker where text input is read only

    - by Rowan Parker
    Hi all, I want to use the Jquery datepicker. I've got it setup using an the alt field option. I'm displaying Y-M-D in the text field, but submitting Y-M-D. Everything works fine so far, sending the correct data, etc. However I want to stop the user from being able to manually type a date. I add originally set the INPUT field to disabled, which worked in every browser except IE. In IE it would popup the date picker but then not close after clicking a date. Does anyone know the best way to do this?

    Read the article

  • Batch file: Extracting substring from input parameter to use in IF statement

    - by Neomoon
    This is a very basic example of what I am trying to implement in a more complex batch file. I would like to extract a substring from an input parameter (%1) and branch based on if the substring was found or not. @echo off SETLOCAL enableextensions enabledelayedexpansion SET _testvariable=%1 SET _testvariable=%_testvariable:~4,3% ECHO %_testvariable% IF %_testvariable%=act CALL :SOME IF NOT %_testvariable%=act CALL :ACTION :SOME ECHO Substring found GOTO :END :ACTION ECHO Substring not found GOTO :END ENDLOCAL :END This is what my ouput looks like: C:\>test someaction act =act was unexpected at this time. If possible I would like to turn this in to a IF/ELSE statement and evaluate directly from %1. However I have not had success with either.

    Read the article

  • C# / Filter input of a textbox and display notification balloon

    - by asmo
    I'm wondering how to filter the input of a .NET textbox. I already know that I could listen for the KeyDown event and intercept the key, but that won't filter pasted strings by a right-click menu or a CTRL+V. I also don't wan't to completely disable the possibility of pasting of characters in the textbox. The paste action should be cancelled whenever it contains one or more invalid characters. Finally, I'd like to display a notification balloon whenever invalid characters are either entered or pasted. µTorrent already has this exact behavior: How can I achieve this functionality in C# ?

    Read the article

  • ASP.NET TextBox verses input type="text" behavior

    - by harrije
    I notice with ASP.NET if the server side control TextBox is used with out autopostback it will not submit (or postback) the form when typed text ends with enter, which is different from the behavior for plain old HTML pages. Fine, I can set autopostback to get the behavior I want after the enter key. However, autopostback will also cause submit (or postback) when the typed text does not end with enter but focus has changed (i.e. with tab or mouse click), which again is different from plain old HTML pages. How can I get an ASP.NET page to behave the same as a plain old HTML page with respect to text input regardless of whether enter key or change of focus occurs?

    Read the article

  • [PHP] Weird problem with dynamic method invocation

    - by Rolf
    Hi everyone, this time, I'm facing a really weird problem. I've the following code: $xml = simplexml_load_file($this->interception_file); foreach($xml->children() as $class) { $path = str_replace('__CLASS_DIR__',CLASS_DIR,$class['path']); if(!is_file($path)) { throw new Exception('Bad configuration: file '.$path.' not found'); } $className = pathinfo($path,PATHINFO_FILENAME); foreach($class as $method) { $method_name = $method['name']; $obj = new $className(); var_dump(in_array($method_name,get_class_methods($className)));exit; echo $obj->$method_name();### not a method ??? } } As you can see, I get the class name and method name from an XML file. I can create an instance of the class without any problem. The var_dump at the end returns true, that means $method_name (which has 2 optional parameters) is a method of $className. BUT, and I am pretty sure the syntax is correct, when I try: $obj-$method_name() I get: Fatal error: Method name must be a string If you have any ideas, pleaaaaase tell me :) Thanks in advance, Rolf

    Read the article

  • iPhone Input with Stacked Views

    - by Forrest
    Hi, I've got a situation in an iphone application where buttons are not receiving input as I expect. Here's the setup: ViewMain - The main view full of various images and labels ViewOverlay - A HUD like overlay view with two UIButton objects. To create my scene I do the following: viewController.view = ViewMain [ViewMain addsubview:ViewOverlay] This view renders as expected, with ViewOverlay correctly rendered ontop of ViewMain. However the two buttons found inside ViewOverlay do not receive touch events and can not be pressed. Tapping them does nothing at all. I very well may be going about this in the entirely wrong direction. Any ideas?

    Read the article

  • Is it safe to display user input as input values without sanitation?

    - by Svish
    Say we have a form where the user types in various info. We validate the info, and find that something is wrong. A field is missing, invalid email, et cetera. When displaying the form to the user again I of course don't want him to have to type in everything again so I want to populate the input fields. Is it safe to do this without sanitation? If not, what is the minimum sanitation that should be done first? And to clearify: It would of course be sanitized before being for example added to a database or displayed elsewhere on the site.

    Read the article

  • c++ strings and file input

    - by Dalton Conley
    Ok, its been a while since I've done any file input or string manipulation but what I'm attempting to do is as follows while(infile >> word) { for(int i = 0; i < word.length(); i++) { if(word[i] == '\n') { cout << "Found a new line" << endl; lineNumber++; } if(!isalpha(word[i])) { word.erase(i); } if(islower(word[i])) word[i] = toupper(word[i]); } } Now I assume this is not working because skips the new line character?? If so, whats a better way to do this.

    Read the article

  • How to detect if a form input element of type file is empty

    - by Ankur
    I have some code which reads a file through a form field of type file <input type="file" ... /> I want to give the user another option of providing a url to a file rather than having to upload it as many are already online. How can I detect when this field is empty on the server side. I am using Apache Commons FileUpload FileItemStream item = iter.next(); name = item.getFieldName(); stream = item.openStream(); if(!item.isFormField()){ if(item.toString()!=""){ .... I need to detect when item is empty. The above code doesn't work, nor does using: if(item.equals(null)){ ....

    Read the article

  • CSS bug in text input field - MSIE7

    - by Uri Bruck
    I have an input text in a form that has a problem in MSIE7. When the text field is filled and I continue typing, the background starts scrolling left along with the text. This is the form when the text field is filled http://img155.imageshack.us/i/screen2rl.jpg/ The background image, a white rectangle with rounded corners, scrolls left with the text, leaving the black background. This is the CSS for this text field: border: none; background: url('/wp-content/themes/pokerbuddy/images/field.png') top left no-repeat; width: 100px; height: 20px; padding: 0px; font-size: 80%; color: #399; display:inline; Is there any way to solve this in MSIE7?

    Read the article

  • Flex Application for PlayBook Text Input Variable

    - by user568128
    I know this is probably a very simple question, but can someone please walk me through how to take what a user inputs into a s:TextInput and use that as a variable in a JSON data request? Basically, I want to have a user enter a search term, like "math" and then have that placed into a variable so I can use it in a JSON request. Something like public var q:String, except that my search box (and hence user input) is on another "view" of the application. I've just started with Flex Mobile applications and I might be way out of my league. Does anyone know how to do this?

    Read the article

  • When using method chaining, do I reuse the object or create one?

    - by MainMa
    When using method chaining like: var car = new Car().OfBrand(Brand.Ford).OfModel(12345).PaintedIn(Color.Silver).Create(); there may be two approaches: Reuse the same object, like this: public Car PaintedIn(Color color) { this.Color = color; return this; } Create a new object of type Car at every step, like this: public Car PaintedIn(Color color) { var car = new Car(this); // Clone the current object. car.Color = color; // Assign the values to the clone, not the original object. return car; } Is the first one wrong or it's rather a personal choice of the developer? I believe that he first approach may quickly cause the intuitive/misleading code. Example: // Create a car with neither color, nor model. var mercedes = new Car().OfBrand(Brand.MercedesBenz).PaintedIn(NeutralColor); // Create several cars based on the neutral car. var yellowCar = mercedes.PaintedIn(Color.Yellow).Create(); var specificModel = mercedes.OfModel(99).Create(); // Would `specificModel` car be yellow or of neutral color? How would you guess that if // `yellowCar` were in a separate method called somewhere else in code? Any thoughts?

    Read the article

  • x axis detection issues platformer starter kit

    - by dbomb101
    I've come across a problem with the collision detection code in the platformer starter kit for xna.It will send up the impassible flag on the x axis despite being nowhere near a wall in either direction on the x axis, could someone could tell me why this happens ? Here is the collision method. /// <summary> /// Detects and resolves all collisions between the player and his neighboring /// tiles. When a collision is detected, the player is pushed away along one /// axis to prevent overlapping. There is some special logic for the Y axis to /// handle platforms which behave differently depending on direction of movement. /// </summary> private void HandleCollisions() { // Get the player's bounding rectangle and find neighboring tiles. Rectangle bounds = BoundingRectangle; int leftTile = (int)Math.Floor((float)bounds.Left / Tile.Width); int rightTile = (int)Math.Ceiling(((float)bounds.Right / Tile.Width)) - 1; int topTile = (int)Math.Floor((float)bounds.Top / Tile.Height); int bottomTile = (int)Math.Ceiling(((float)bounds.Bottom / Tile.Height)) - 1; // Reset flag to search for ground collision. isOnGround = false; // For each potentially colliding tile, for (int y = topTile; y <= bottomTile; ++y) { for (int x = leftTile; x <= rightTile; ++x) { // If this tile is collidable, TileCollision collision = Level.GetCollision(x, y); if (collision != TileCollision.Passable) { // Determine collision depth (with direction) and magnitude. Rectangle tileBounds = Level.GetBounds(x, y); Vector2 depth = RectangleExtensions.GetIntersectionDepth(bounds, tileBounds); if (depth != Vector2.Zero) { float absDepthX = Math.Abs(depth.X); float absDepthY = Math.Abs(depth.Y); // Resolve the collision along the shallow axis. if (absDepthY < absDepthX || collision == TileCollision.Platform) { // If we crossed the top of a tile, we are on the ground. if (previousBottom <= tileBounds.Top) isOnGround = true; // Ignore platforms, unless we are on the ground. if (collision == TileCollision.Impassable || IsOnGround) { // Resolve the collision along the Y axis. Position = new Vector2(Position.X, Position.Y + depth.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } //This is the section which deals with collision on the x-axis else if (collision == TileCollision.Impassable) // Ignore platforms. { // Resolve the collision along the X axis. Position = new Vector2(Position.X + depth.X, Position.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } } } } // Save the new bounds bottom. previousBottom = bounds.Bottom; }

    Read the article

  • in python: can i pass class method as and a default argument to another class method

    - by alex
    i want to to pass class method as and a default argument to another class method, so that i can re-use the method as a @classmethod @classmethod class foo: def func1(self,x): do somthing; def func2(self, aFunc = self.func1): # make some a call to afunc afunc(4) this why when the method func2 is called within the class aFunc defaults to self.func1, but i can call this same function from outside of the class and pass it a different function at the input. i get NameError: name 'self' is not defined

    Read the article

  • How to name a static factory method in the utility class?

    - by leventov
    I have an interface MyLongNameInterface with a counterpart utility class MyLongNameInterfaces. What is the best name for a static factory method in the utility class, which creates an instance of MyLongNameInterface? MyLongNameInterfaces.newInstance() -- a new instance of the utility class? MyLongNameInterfaces.newMyLongNameInterface() -- too verbose MyLongNameInterfaces.create() -- create an instance of the utility class? Also, create is not a widely used conventional verb in Java better option?

    Read the article

  • How to disable the all Fieldset Input, textarea, select except input checkbox

    - by kumar
    Hello friends, I have this code in my view this code will execute each users based on selection if I select 3 users this code will execute three times and displays three seperates in same page with differnt users.. Here is my code... I used this code.. this is disabling only frist user Fieldset not for all other fieldsets? and in this Fieldset Except Input check box I need to disabled all other Inpu,select,textarea.. need to disabled.. Please can any one help me I need to hide all the Fieldsets.. thanks

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >