Search Results

Search found 28782 results on 1152 pages for 'input language'.

Page 10/1152 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • jQuery input mask length

    - by Tim
    Hey all, I have an input field and I want to limit it to alphanumerical (A-Z, a-z, 0-9) characters only, with a MINIMUM field length of 5, and a maximum length of up to 15 characters total. Does anyone know how I can do this using jQuery? I'm trying to use the jQuery input mask by digitalBush - http://digitalbush.com/projects/masked-input-plugin/ The problem is that UNLESS I enter 15 characters, the field goes blank. If I enter "012345678912345" (15 characters) in the input field then the value is stored and it's fine. But if I enter "12345" as a username, when that input box loses focus its value goes back to being blank. Is there something that I can change in the "definitions" or options somewhere that fixes this? Many thanks for your help :) Tim

    Read the article

  • Put text input inside label for radio button?

    - by Martijn
    I'm trying to make a radio group specifying a bunch of options, and an extra option "other" with a text input to specify. The code for this particular radio button I'm using is <input type='radio' name='RadioInput' value='Other' id='RadioInput_Other' /> <label for='RadioInput_Other'>Ohter: <input type='text' name='RadioInput_Other_Value' id='RadioInput_Other_Value' value='' /> </label> The idea is that if you give focus to the text input, the radio button corresponding to it is selected. The code above almost does this (since the text input is inside the label). However, it also shifts focus to the radio button (which is annoying, since whatever you type next is lost). Is there any way to prevent this using XHTML1.0 / CSS2? Preferably without using javascript.

    Read the article

  • Want to bind an input field to a jquery-ui slider handle

    - by BFTrick
    hello, I want to bind an input field to the jquery-ui slider handle. So whenever one value changes I want the other value to also change. Ex: if someone types 1000 into the minimum value input field I want the lower slider handle to move to the 1000 mark. Also if the user drags the lower slider handle to 1000 the input field should reflect that. Making the slider reflect the changes in the input field is easy: $(minYearInput).blur(function () { $("#yearSlider").slider("values", 0, parseInt($(this).val())); }); $(maxYearInput).blur(function () { $("#yearSlider").slider("values", 1, parseInt($(this).val())); }); I just need help making the text fields mimic the slider. $("#yearSlider").slider({ range: true, min: 1994, max: 2011, step: 1, values: [ 1994 , 2011 ], slide: function(event, ui) { //what goes here? } }); Any ideas? A similar question from this site: http://stackoverflow.com/questions/1330008/jquery-ui-slider-input-a-value-and-slider-move-to-location

    Read the article

  • Cross Browser input field width stylization

    - by Derek Adair
    Hi, I have a shipping/billing input form and I'm having trouble styling the input fields to be the same width... Here is a link (click one of the order bottles to go to the checkout page which contains the form) The Problem: -a field <input type="text" size="X" /> appears to render with different sizes in different browsers (see link). -In addition, select fields seem to render on a differently as well. -Chrome/safari do not seem to respond to the font-size property for select fields. Any guidance on how to stylize the size of text-input and select fields cross-browser would be oh so very helpful. Must I result to having a different sytlesheet for each browser... just for these input fields? -thanks

    Read the article

  • "Intercepting" user input into text box and removing it

    - by James P
    I have a text box that I would like to do some validation on. At the moment I have this code: function updateChanger() { // Validate input var likeMessage = validateInput($("#like").val()); alert(likeMessage); } function validateInput(input) { input = input.replace(/[^a-zA-Z0-9:\(\/\)\s\.,!~]/g, ""); return input; } This successfully trims out unwanted characters in the likeMessage variable, but the character still gets entered into the text box. I would like to stop that from happening. I know it will have something to do with $("#like").val() but the only thing I can think of is just chopping off the end character from the text box value, would this suffice? Thanks for any help!

    Read the article

  • C input loop for shell

    - by AustinM
    So I'm working on creating a very simple C program that just preforms shell commands. This is what I have so far: #include <stdio.h> int main() { char input[30]; fputs("$ ", stdout); fflush(stdout); fgets(input, sizeof input, stdin); system(input); } It works, but only for one command. For example if I compile and type ./cmd I get the $ prompt. If I type ls I get what I'm supposed to get. But then it exits and goes back to the regular system shell. How can I make it so after the user types a command it goes back to the "$" input.

    Read the article

  • jQuery Mobile focus next input on keypress

    - by user738175
    I have a jquery mobile site with a html form consisting of 4 pin entry input boxes. I want the user to be able to enter a pin in each input field without having to press the iphone keyboards "next" button. I have tried the following and although it appears to set the focus to the second input and insert the value, the keyboard disappears so the user still has to activate the required input with a tap event. $('#txtPin1').keypress(function() { $('#txtPin1').bind('change', function(){ $("#txtPin1").val($("#txtPin1").val()); }); $("#txtPin2").focus(); $("#txtPin2").val('pin2'); }); Is there a different event that I should be assigning to $("#txtPin2")? I have tried to implement http://jqueryminute.com/set-focus-to-the-next-input-field-with-jquery/ this also, but I found that it worked for android and not for iphone. Any help is greatly appreciate it.

    Read the article

  • htaccess on remote server issues - password prompt not accepting input

    - by pying saucepan
    EDIT: I will contact the university about my problem after labor day weekend, but I thought if someone knew a quick fix that I haven't tried, or if the problem has an obvious fix then I could hope to try my luck here, thanks! TLDR: Sorry its a long post, I thought I should be... thorough. I am having a common issue (found a dead thread through google with no solution to the same problem) with the prompt to enter in a username and password via htaccess rights, but this prompt will keep popping up asking for a username and password when trying to access my home directory on my university's server which has the .htaccess and .htpasswd files. It does not matter if I enter in correct or incorrect credentials, the prompt will keep asking me for input without displaying my home directory. Ever since I have included these ht files I have never once been able to get past the username/password no matter what I have tried, save for removing them from the directory I am trying to access (my top level directory that I own). This kind of served my original goal of making the top level directory inaccessible to casual users, but if I wanted to use this method on other places, I would want it to work as intended. And I also like it when computers do what I wish they would, so any help is appreciated. Some things I have tried: Changing the file/directory access rights: they told me to try these commands if people can't access my files cd ~/public_html find ./ -type d -exec chmod 755 {} \; find ./ -type f -exec chmod 644 {} \; enter in the single character name/pw at least twenty times in a row, no cheddar. so I changed directory with cd ~ in hopes that this would be my home directory, since my home directory contains the "public_html" directory, so logic tells me that the ~ tilde symbol is the top level directory that I have ownership of. Then I did those two commands to change the rights on the files inside, I am still having no luck. How I got to this point: I have been following the instructions given to me through my university's website for setting up my little directory. A link on how they describe how to password protect the home directory is given below: "Protect Web Directories" instructions I have everything in order except for one small detail that I feel probably does not matter. I am on windows and so I am using winSCP to remote control my allocated server space. The small detail is that as the instructions indicate (on step 3) that I should use the command htpasswd -c .htpasswd {username} where {username} is my folder that holds my allocated server space. But this command requires further input through the terminal, and unfortunately winSCP does not offer this kind of functionality. So I looked up some basic instructions on using htaccess and it is formatted correctly such that the .htaccess file appears as follows: AuthType Basic AuthName "Verify" AuthUserFile /correctpath/.htpasswd require valid-user and this file is in the root directory for my server space as well as the .htpasswd file which has only this data inside: username:password I know for sure that these two files must be formatted correctly, at least according to their tutorial, because before my path was incorrectly formatted via including some curly { braces } without knowing the correct way to do this at first. And the password prompt that shows up when accessing my directory responded by loading an error page indicating to contact OSU admin or something not important. But now that I have everything like it 'should' be. I know this because when I enter in my credentials "username and password" the prompt pops up for my username and password again and again whether or not I enter in correct information. The only exception is that if I click cancel it will direct me to a page saying that I need to enter in a username and password. Note that I am very inexperienced at server-related buisness, two days ago I couldn't have told you what a website actually consists of. So, if you use some technical jargon I may or may not need to look it up and get back to you before I actually understand what you mean, but I am a quick learner and it probably wont matter.

    Read the article

  • Realtek HD Audio 5.1 Optical Input (from Xbox 360)

    - by Shevek
    I'm trying to connect up my Xbox 360 digital audio to my 5.1 speakers via my PC (my LCD has dual input, DVI for the PC, D-SUB for the Xbox). The motherboard has a Realtek ALC888 chipset and I have a 5.1 speaker system connected via 3 x 3.5mm jacks (FR/FL, RR/RL, C/LFE) and I get full 5.1 output from the PC. I have connected the optical audio cable from the Xbox to the Optical In on the motherboard's backplate. With the Xbox in Digital Stereo mode I get 2 channel audio from the Xbox, through the PC, to the speakers. With the Xbox in Dolby Digital 5.1 mode I get no sound at all. I have the latest Realtek drivers installed in Win 7 32-bit. Questions: Is it possible to use the full 5.1 DD from the Xbox? If so, am I missing some option(s) in the Realtek setup? Do I need some other piece of software to do this? (AC3Filter or FFDShow perhaps) Many thanks

    Read the article

  • Choice of Input / music / graphics libraries for an indie game - what factors should I consider?

    - by RusselMeMan
    I was wondering which tools (grapics-sound-input libraries, game engine libraries) that the following indie games used: Braid Superbrothers: S&S Super Meat Boy Limbo Fez (I know this one is XNA) Also, what is in common use in production games? My guess for game development in C++ is: -DirectX is most common for  Windows games -SDL or SDL+OpenGL is most common for  Linux games -OpenGL + Apple APIs are most common for OSX development What do most indie game projects use? If I wanted to casually build my own game for fun in C++ with the idea of possibly releasing it to Steam or something someday, is there anything I should be concerned about if I make it with DirectX for music/sound/input and build my own game engine? Thanks!

    Read the article

  • What actions should I not rely on the packaged functionality of my language for?

    - by David Peterman
    While talking with one of my coworkers, he was talking about the issues the language we used had with encryption/decryption and said that a developer should always salt their own hashes. Another example I can think of is the mysql_real_escape_string in PHP that programmers use to sanitize input data. I've heard many times that a developer should sanitize the data themselves. My question is what things should a developer always do on their own, for whatever reason, and not rely on the standard libraries packaged with a language for it?

    Read the article

  • Audio input problem in Ubuntu 9.10

    - by Andrea Ambu
    My audio input is a mix of my mic output and my sound card output. I'd like it to be just my mic output. I was able to do so in Ubuntu 9.04 but the interface is 9.10 is totally changed and I tried every my creativity was able to think. It's really annoying when talking to other people over the internet because they keep hearing their voice back. I'm not sure I explained it in clear way so I'll give you an example: What I do: I put an mp3 on play or a video on youtube then open a recorder and start to talk on my mic. What happens: both my voice and audio from mp3/youtube get reordered, even if I put headphones volume to 0 (via hardware). What I'd like to happen: Only my voice should be recorded. I'm sure I'm missing some technical term, but that's the problem and I'd like to solve it in Ubuntu 9.10, any idea?

    Read the article

  • An alternative to reading input from Java's System.in

    - by dvanaria
    I’m working on the UVa Online Judge problem set archive as a way to practice Java, and as a way to practice data structures and algorithms in general. They give an example input file to submit to the online judge to use as a starting point (it’s the solution to problem 100). Input from the standard input stream (java.lang.System.in) is required as part of any solution on this site, but I can’t understand the implementation of reading from System.in they give in their example solution. It’s true that the input file could consist of any variation of integers, strings, etc, but every solution program requires reading basic lines of text input from System.in, one line at a time. There has to be a better (simpler and more robust) method of gathering data from the standard input stream in Java than this: public static String readLn(int maxLg) { byte lin[] = new byte[maxLg]; int lg = 0, car = -1; String line = “”; try { while (lg < maxLg) { car = System.in.read(); if ((car < 0) || (car == ‘\n’)) { break; } lin[lg++] += car; } } catch (java.io.IOException e) { return (null); } if ((car < 0) && (lg == 0)) { return (null); // eof } return (new String(lin, 0, lg)); } I’m really surprised by this. It looks like something pulled directly from K&R’s “C Programming Language” (a great book regardless), minus the access level modifer and exception handling, etc. Even though I understand the implementation, it just seems like it was written by a C programmer and bypasses most of Java’s object oriented nature. Isn’t there a better way to do this, using the StringTokenizer class or maybe using the split method of String or the java.util.regex package instead?

    Read the article

  • Choice of programming language for learning data structures and algorithms

    - by bguiz
    Which programming language would you recommend to learn about data structures and algorithms in? Considering the follwing: Personal experience Language features (pointers, OO, etc) Suitability for learning DS & A concepts I ask because there are some books out there that are programming language-agnostic (written from a Mathematical perspective, and use pseudocode). If I learn from one of these I would like to work out the algorithms in a chosen language. Then, there are other books which introduce DS & A concepts with examples in a particular programming laguage - and I would follow these examples as well. Either way, I have to choose a language, and I would like to stick to one throughout. Which one best fits the bill.

    Read the article

  • How to detect the language of MS Excel from C#

    - by Babba
    If i try to use Excel from C# (interop) i receive error (HRESULT: 0x80028018) when current thread language is different from Excel language: so i need to set thread language, they must be the same. Which is the best method to understand the language of Excel/Office? 1) registry (HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\LanguageResources\UILanguage ? How understand wich version (12.0/14.0/...?) 2) with Application like suggested here (http://stackoverflow.com/questions/2804556/how-to-detect-the-language-of-ms-excel) ? It's ok but i need a strong reference to a specific version Microsoft.Office.Core and so i can't do it for different versione of Office: Excel.Application application = new Excel.Application(); int iUi = application.LanguageSettings.get_LanguageID(Microsoft.Office.Core.MsoAppLanguageID.msoLanguageIDUI); MessageBox.Show(iUi.ToString()); 3) other?

    Read the article

  • Update Input Value With jQuery, Old Value Submitted to Form

    - by Tyler DeWitt
    I've got a form with an input with id/name league_id <form accept-charset="UTF-8" action="/user" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="?"><input name="authenticity_token" type="hidden" value="bb92urX83ivxOZZJzWLJMcr5ZSuamowO9O9Sxh5gqKo="></div> <input id="league_id" name="league_id" type="text" value="11"> <select class="sport_selector" id="sport_type_id" name="sport_type_id"><option value="5" selected="selected">Football</option> <option value="25">Women's Soccer</option> <option value="30">Volleyball</option> <option value="10">Men's Soccer</option></select> <input name="commit" type="submit" value="Save changes"> </form> In another part of my page, I have a drop down that, when changed, clears the value of league_id $("#sport_type_id").change -> $("#league_id").val(null) $(this).parents('form:first').submit() If I debug this page, I can see the value get wiped from the text box, but when the form is submitted, my controller always gets the old value. I tried changing the name of the input and got the same results.

    Read the article

  • How to change Skype language in MacBook Pro running Mac OS X version 10.6.8?

    - by Zuul
    I am unable to change the Skype language from English to Portuguese in MacBook Pro running Mac OS X version 10.6.8. What I have done: I've downloaded the Portuguese version of Skype; I have under OSX ? System Preference ? Language & Text the language and country set to Portugal; I have my Skype account country and language set to Portugal, Portuguese. Still the Skype application is using English and AFAIK no menu exists to change the application language within the application itself. I was under the impression that Skype would collect the language from my system preferences as to properly present the menus. How can I change the language to Portuguese then?

    Read the article

  • Why does Windows 7 always automatically change the input or keyboard language?

    - by B-Ball
    I am wondering why Windows 7 always automatically changes my input or keyboard language. I've a notebook with an integrated QWERTY keyboard English (United States). Traveling, I use that one but, additionally, I've my own as well as a much better keyboard at home which is a QWERTZ keyboard German (Germany). Thus, being at home, I'd like to use my QWERTZ keyboard. Unfortunately, Windows 7 does not play along at this one. Every time, I start up my notebook, it is usually set to English (United States) but that's not the problem. In case, I'd use my notebook QWERTY keyboard English (United States), that's fine. However, if I start up my notebook and I'd like to use my QWERTZ keyboard German (Germany), I usually press ALT + Left Shift in order to switch from English (United States) to German (Germany) and Windows 7 switches the input language but only for the program that is currently open. If my input language is set to German (Germany) and I, e.g., open NotePad, Windows 7 automatically switches my input language to English (United States). This is very annoying since I've to change the input or keyboard language to German (Germany) every time I open up a new program. Why doesn't Windows 7 stay with one input language if I changed it manually by pressing ALT + Left Shift? Why doesn't the manual change of the input or keyboard language apply for the whole Windows 7? Why does it only affect the currently opened program? Since I've two keyboards with two different layouts, I seriously need to have both of the keyboards languages installed. I tried both of the below settings in order to find a solution for my problem. Currently, I am using the first option, two input languages. First option: two input languages: Second option: two keyboard languages:

    Read the article

  • how to remove trailing and leading whitespace for user-provided input in dos?

    - by OopOop
    I know how to do this when the variable is pre-defined. However, when asking for the user to enter in some kind of input, how do I trim leading and trailing whitespace? This is what I have so far: @echo off set /p input=: echo. The input is %input% before ::trim left whitespace for /f "tokens=* delims= " %%a in ("%input%") do set input=%%a ::trim right whitespace (up to 100 spaces at the end) for /l %%a in (1,1,100) do if "!input:~-1!"==" " set input=!input:~0,-1! echo. The input is %input% after pause Thank you! :)

    Read the article

  • Formal definition for term "pure OO language"?

    - by Yauhen Yakimovich
    I can't think of a better place among SO siblings to pose such a question. Originally I wanted to ask "Is python a pure OO language?" but considering troubles and some sort of discomfort people experience while trying to define the term I decided to start with obtaining a clear definition for the term itself. It would be rather fair to start with correspondence by Dr. Alan Kay, who has coined the term (note the inspiration in biological analogy to cells or other living objects). There are following ways to approach the task: Give a comparative analysis by listing programming languages that exhibits certain properties unique and sufficient to define the term (although Smalltalk and Java are passing examples but IMO this way seems neither really complete or nor fruitful) Give a formal definition (or close to it, e.g. in more academic or mathematical style). Give a philosophical definition that would totally rely on semantical context of concrete language or a priori programming experience (there must be some chance of successful explanation by the community). My current version: "If a certain programing (formal) language that can (grammatically) differentiate between operations and operands as well as infer about the type of each operand whether this type is an object (in sense of OOP) or not then we call such a language an OO-language as long as there is at least one type in this language which is an object. Finally, if all types of the language are also objects we define such language to be pure OO-language." Would appreciate any possible improvement of it. As you can see I just made the definition dependent on the term "object" (often fully referenced as class of objects).

    Read the article

  • What constitutes a programming language and how does one copyright a programming language?

    - by Yannbane
    I've decided to create a programming language of my own, mostly just for fun. However, I got interested in the legal aspect of it all. You can, for example, licence specific programs under specific terms. However, how do you go about licensing a language? Also, by that I don't just mean the implementation of the language (compiler & VM), but the standard itself. Is there something else to a programming language I'm missing? What I would like to achieve by such licensing: Make it completely FOSS (can a language even be FOSS, or is that the implementation that can be FOSS?) Establish myself as the author (can you legally be an author of a language? Or, again, just the implementation?) Make it so that anyone implementing my language would be required to attribute me (MIT-style. Please note that I do not have any hopes for anyone actually ever doing that though, I'm just learning.) I think that the solution would be to separately license the VM and the compiler for my language, as "the official implementation", and then license the design document as the language itself. What exactly am I missing here?

    Read the article

  • Using Groovy as a scripting language...

    - by Zombies
    I prefer to use scripting languages for short tasks, anything such as a really simple http bot, bulk importing/exporting data to/from somewhere, etc etc... Basic throw-away scripts and simple stuff. The point being, that a scripting language is just an efficient tool to write quick programs with. As for my understanding of Groovy at this point... If you were to program in Groovy, and you wan't to write a quick script, wouldn't you be forced to going back to regular java syntax (and we know how that can be convoluted compared to a scripting language) in order to do anything more complicated? For example, if I want to do some http scripting, wouldn't I just be right back at using java syntax to invoke Commons HttpClient? To me, the point of a scripting language is for quickly typed and less forced constructs. And here is another thing, it doesn't seem that there is any incentive for groovy based libraries to be developed when there are already so many good java one's out there, thus making groovy appear to be a Java dependent language with minor scripting features. So right now I am wondering if I could switch to Groovy as a scripting language or continue to use a more common scripting language such as Perl, Python or Ruby.

    Read the article

  • How would I handle input with a Game Component?

    - by Aufziehvogel
    I am currently having problems from finding my way into the component-oriented XNA design. I read an overview over the general design pattern and googled a lot of XNA examples. However, they seem to be right on the opposite site. In the general design pattern, an object (my current player) is passed to InputComponent::update(Player). This means the class will know what to do and how this will affect the game (e.g. move person vs. scroll text in a menu). Yet, in XNA GameComponent::update(GameTime) is called automatically without a reference to the current player. The only XNA examples I found built some sort of higher-level Keyboard engine into the game component like this: class InputComponent: GameComponent { public void keyReleased(Keys); public void keyPressed(Keys); public bool keyDown(Keys); public void override update(GameTime gameTime) { // compare previous state with current state and // determine if released, pressed, down or nothing } } Some others went a bit further making it possible to use a Service Locator by a design like this: interface IInputComponent { public void downwardsMovement(Keys); public void upwardsMovement(Keys); public bool pausedGame(Keys); // determine which keys pressed and what that means // can be done for different inputs in different implementations public void override update(GameTime); } Yet, then I am wondering if it is possible to design an input class to resolve all possible situations. Like in a menu a mouse click can mean "click that button", but in game play it can mean "shoot that weapon". So if I am using such a modular design with game components for input, how much logic is to be put into the InputComponent / KeyboardComponent / GamepadComponent and where is the rest handled? What I had in mind, when I heard about Game Components and Service Locator in XNA was something like this: use Game Components to run the InputHandler automatically in the loop use Service Locator to be able to switch input at runtime (i.e. let player choose if he wants to use a gamepad or a keyboard; or which shall be player 1 and which player 2). However, now I cannot see how this can be done. First code example does not seem flexible enough, as on a game pad you could require some combination of buttons for something that is possible on keyboard with only one button or with the mouse) The second code example seems really hard to implement, because the InputComponent has to know in which context we are currently. Moreover, you could imagine your application to be multi-layered and let the key-stroke go through all layers to the bottom-layer which requires a different behaviour than the InputComponent would have guessed from the top-layer. The general design pattern with passing the Player to update() does not have a representation in XNA and I also cannot see how and where to decide which class should be passed to update(). At most time of course the player, but sometimes there could be menu items you have to or can click I see that the question in general is already dealt with here, but probably from a more elobate point-of-view. At least, I am not smart enough in game development to understand it. I am searching for a rather code-based example directly for XNA. And the answer there leaves (a noob like) me still alone in how the object that should receive the detected event is chosen. Like if I have a key-up event, should it go to the text box or to the player?

    Read the article

  • javascript to reference input IDs in php loop and pass values back to same input ID

    - by Smudger
    I have a form which is essentially an autocomplete input box. I can get this to work perfectly for a single text box. What I need to do is create unique input boxes by using a php for loop. This will use the counter $i to give each input box a unique name and id. The problem is that the unique value of the input box needs to be passed to the javascript. this will then pass the inputted data to the external php page and return the mysql results. As mentioned I have this working for a single input box but need assistance with passing the correct values to the javascript and returning it to correct input box. existing code for working solution (first row works only, all other rows update first row input box) <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("autocompleteperson.php", {queryString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 200); } </script> </head> <body> <form name="form1" id="form1" action="addepartment.php" method="post"> <table> <? for ( $i = 1; $i <=10; $i++ ) { ?> <tr> <td> <? echo $i; ?></td> <td> <div> <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 20px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> &nbsp; </div> </div> </td> </tr> <? } ?> </table> </body> </html> code for autocompleteperson.php is: $query = $db->query("SELECT fullname FROM Persons WHERE fullname LIKE '$queryString%' LIMIT 10"); if($query) { while ($result = $query ->fetch_object()) { echo '<li onClick="fill(\''.$result->fullname.'\');">'.$result->fullname.'</li>'; } } in order to get it to work for all rows, I include the counter $i in each of the file names as below: <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function lookup(inputString<? echo $i; ?>) { if(inputString<? echo $i; ?>.length == 0) { // Hide the suggestion box. $('#suggestions<? echo $i; ?>').hide(); } else { $.post("autocompleteperson.php", {queryString: ""+inputString<? echo $i; ?>+""}, function(data){ if(data.length >0) { $('#suggestions<? echo $i; ?>').show(); $('#autoSuggestionsList<? echo $i; ?>').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString<? echo $i; ?>').val(thisValue); setTimeout("$('#suggestions<? echo $i; ?>').hide();", 200); } </script> </head> <body> <form name="form1" id="form1" action="addepartment.php" method="post"> <table> <? for ( $i = 1; $i <=10; $i++ ) { ?> <tr> <td> <? echo $i; ?></td> <td> <div> <input type="text" size="30" value="" id="inputString<? echo $i; ?>" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions<? echo $i; ?>" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 20px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList<? echo $i; ?>"> &nbsp; </div> </div> </td> </tr> <? } ?> </table> </body> </html> The autocomplete suggestion works (although always shown on first row) but when selecting the data always returns to row 1, even if input was on row 5. I have a feeling this has to do with the fill() but not sure? is it due the the autocomplete page code? or does the fill referencing ThisValue have something to do with it. example of this page (as above) can be found here Thanks for the assistance, much appreciated. UPDATE - LOLO <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function lookup(i, inputString) { if(inputValue.length == 0) { // Hide the suggestion box. $('#suggestions' + i).hide(); } else { $.post("autocompleteperson.php", {queryString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions' + i).show(); $('#autoSuggestionsList' + i).html(data); } }); } } // lookup function fill(i, thisValue) { $('#inputString' + i).val(thisValue); setTimeout("$('#suggestions' + i).hide();", 200); } </script> </head> <body> <form name="form1" id="form1" action="addepartment.php" method="post"> <table> <? for ( $i = 1; $i <=10; $i++ ) { ?> <tr> <td> <? echo $i; ?></td> <td> <div> <input type="text" size="30" value="" id="inputString<?php echo $i; ?>" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions<? echo $i; ?>" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 20px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList<? echo $i; ?>"> &nbsp; </div> </div> </td> </tr> <? } ?> </table> </body> </html> google chrome catched the following errors: first line on input, second line on loosing focus

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >