input

C++ Opening a file and inputting data to a class object

Simple question, hopefully an easy way and just want to verify I'm doing it the correct / efficient way. I have a class T object, which is typically put into a vector that is created in my main() function. It can be any kind of data, string, int, float.. etc. I'm reading from a file... which is inputted from the user and passed onto t...

Trapping second keyboard input in (ubuntu) linux

I have written a program that gets input from a usb second keyboard (actually a barcode scanner). The problem is that if another window is active the data is input there rather than in my program. Could someone give me advice on what I'm doing wrong? #include <stdio.h> #include <string.h> int main(int argc, char * argv[]){ FILE * fp...

Difference between <input type='button' /> and <input type='submit' />

There is no such thing as a stupid question, so here we go: What is the difference between between <input type='button' /> and <input type='submit' />? ...

Get post values when the key is unknown in CodeIgniter

CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of a form field. This works well for a static form where each input name in known ahead of time. In my case, I am loading a collection of key/value pairs from the database. The form contains a text input for each key/value p...

JavaScript: Check if mouse button down?

Is there a way to detect if a mouse button is currently down in JavaScript? I know about the "mousedown" event, but that's not what I need. Some time AFTER the mouse button is pressed, I want to be able to detect if it is still pressed down. Is this possible? ...

Bizarre Firefox Input Bug

I'm a bit flabbergasted at this, so I'm wondering if any SOers have encountered it before. I have an essentially flat page with a number of input=text seeded in the markup with default values of say A,B,C,D,E in order. The markup looks like this in view source: <td class="action invoice"> <a href="#foo">Toggle Invoice</a> <div clas...

Call FLTK callback whenever value changes in fl_input

I'm working on an FLTK application and I need to have a callback for a fl_input element called whenever the value changes. I have been able to get it to work when the user changes focus but not as they are typing. What is the best way to do this? Thanks, ...

Is there a multiple input JOptionPane in Java?

Hey all, I was wondering if there is a JOptionPane where you can get multiple inputs from a user instead of just one? If not, how could i accomplish this using some type of prompt. I am creating Battleship, and wanted to prompt the user to specify locations to place each ship. Thanks, Tomek ...

How can I validate both for integers and in a range in a ColdFusion form?

In a CF8 form, I'm using a tag such as the following: <cfinput type = "Text" name = "Num" value = "0" validate = "range,integer" range = "0,1000" validateAt="onBlur,onSubmit" required = "yes" message = "Invalid Value" > When the field loses focus (onBlur), the input is validated for only the fi...

Styling issues with a file input field in firefox

Mornin' all! Not entirely sure whats going on here, I am currently doing the front end for a site with looooads of forms, all styled up and looking pretty in IE, but I've just noticed that in firefox the file input fields aren't responding to any of my styles, all the other types of input fields are fine. I've checked it in Firebug and ...

Form with Hidden Tags to cybercart- bring it up on the same page?

Hi, what I want to do is basically this: On ONE page, my customers can click a VIEW CART link and the contents of their cart shows below on that same page. here is my basic link form: <FORM METHOD=post ACTION="http://www.123websiteservices.com/cgi-bin/cybercart.pl"&gt; <INPUT TYPE=hidden NAME=merchant VALUE="jessicas"/> <INPUT TYPE=h...

Input and Output Stream Pipe in Java

Does anyone have any good suggestions for creating a Pipe object in Java which is both an InputStream and and OutputStream since Java does not have multiple inheritance and both of the streams are abstract classes instead of interfaces? The underlying need is to have a single object that can be passed to things which need either an Inpu...

convert a keycode to the relevant display character

In a C# Windows.Forms project I have a control that does not supply the KeyPressed event (It’s a COM control – ESRI map). It only supplies the KeyUp and KeyDown events, containing the KeyEventArgs structure. How can I convert the information in KeyEventArgs to a displayable Unicode character, taking the current active keyboard layout ...

HTML Input Box - Disable

Hi Guys, what is the code to disable an INPUT text box for HTML? Thanks ...

c++ allegro input

I'm building a simple ice sliding puzzle to test uses of allegro. So far I've got the whole thing working although I haven't actually added in the objective yet or the puzzle, just the engine behind it. I'm having a little trouble making "r" jump the player back to the starting spot, can anyone tell me why? #include <allegro.h> #include...

What does CreateFile("CONIN$" ..) do?

I was hacking away the source code for plink to make it compatible with unison. If you don't know, unison is a file synchronization tool, it runs an "ssh" command to connect to a remote server, but there's no ssh.exe for windows; there's plink, which is very close but not close enough (it doesn't behave like unison expects it to), so pe...

IE sends inner HTML when clicking on a button element

I have the following html in my webpage (simplified). <button type="submit" name="action" value="ButtonA">Click Here</button> In Firefox, it submits "ButtonA" as the value for the "action" form value. However, in IE7, it submits "Click Here". Is there any way to resolve this? I don't want to use input tags, because I need to be abl...

(C++) While reading a file (ifstream), is there any way to direct it to make a new line?

While reading a file (ifstream), is there any way to direct it to make a new line? For instance, I would like for THIS to happen: myfile>>array[1]>>array[2]>>endl; Obviously, the "endl" just isn't allowed. Is there another way to do this? Edit---thanks for the quick responses guys! From a text file, I'm trying to store two strings...

PHP - Iterating multiple $_post arrays

Hi all, I have the following code: <tr> <td width="60%"><dl> <dt>Full Name</dt> <dd> <input name="fullname[]" type="text" class="txt w90" id="fullname[]" value="<?php echo $value; ?>" /> </dd> </dl></td> <td width="30%"><dl> <dt>Job Title</dt> <dd>...

Ragel - validate a String while Input

Assume we want to validate user input, while user is typing in a JTextField. For validating the user input, I wonder if I could use Ragel. Assume the input should follow this example regex: [a-z]{2,5}ABC[0-9]+ How can I do this with ragel? Can anybody give a short example how to validate user input "on the fly" (while inputing) with...