input

Kohana input & validation libraries - overlap?

I'm familiarizing myself with Kohana. I've been reading up on the Input library, which automatically pre-filters GET and POST data for me, and the Validation libary, which helps with form filtering and validation. Should I use both together? The examples given in the Validation library documentation use the unfiltered $_POST array ins...

Accessing the value of an input element with XPath in an XSLT

Hi! I'm developing a web app for Firefox that has a button that triggers a client-side XSLT transformation of the document's DOM, with a stylesheet fetched via AJAX. Here's a portion of the XHTML that's going to be transformed: <html> <head> <title>Static Javascript-based XMR Form Creator</title> </head> <body> <h1 id="title">...

C++ open() fails for no apparant reason

The following code: char filename[64]; ifstream input; cout << "Please enter the filename: " << endl; cin >> filename; input.open(filename); if (!input.is_open()) { cout << "Opening file " << filename << " failed." << endl; exit(1); } fails, it enters the if() and exits. What could possibly be the cause for this? I'm using ...

WebForms Text Input => Doubles & Strings & Booleans

Is there a better way to do "input forms" in WebForms? I always end up with code like this: Double d = 0; // chuckle inside if(Double.TryParse(myNumberTextField.Text, out d)) { myObject.DoubleVal = d; } Is there a better way to process free-form "numeric" input. ...

How do I disable backspace when input checkboxes are focused on in jQuery?

How do I disable the backspace button when input checkboxes are focused on in jQuery? When checkboxes are focused on and I press backspace (keycode=8) the browser thinks I'm trying to go back a page and uses backspace as a history.go(-1) command. ADDITION DETAILS--- I've added this--to no avail: $("div#types input").focus(function(){ ...

Getting "Expected ',' or '{' but found '[selector]'" error.

Getting "Expected ',' or '{' but found '#44559'" error. My code looks like this: var valueid = $("div#center-box div#empid-textbox input").val(); //valueid=44559 if($("div#esd-names li#" + valueid).length > 0){ //DO SOMETHING; }; I'm getting the value of what is entered into a textbox input field which in case is "44559" can't see...

Submit a different form depending on character count in jQuery?

Ok, so here's what I want to do, preferably with jQuery 1.4.2: Have one <input type="text"> and one <input type="button"> If the text-input has exactly N number characters, I want a click on the button to submit the form with one action. Else, the button submits the form with another action. Unfortunately I'm a jQuery n00b, and I can...

jQuery .change() on Radio Button

Hi folks, I must be missing something obvious here... I can't get .change() to fire on radio buttons? I have the code below live here! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title>Radio Button...

How to disable backspace if anything other than input field is focused on using jquery

How do I disable backspace keystroke if anything other than 2 specific input fields are focused on using jquery? here is my current code (NOW INCLUDING 2 TEXTBOXES): $(document).keypress(function(e){ var elid = $(document.activeElement).attr('id'); if(e.keyCode === 8 && elid != 'textbox1' || elid != 'textbox2'){ return false;...

How can I concatenate corresponding lines in two files in Perl?

file1.txt hello tom well file2.txt world jerry done How to merge file1.txt with file2.txt; then create a new file - file3.txt hello world tom jerry well done thank you for reading and reply. Attached the completed code which based on the answer. #!/usr/bin/perl use strict; use warnings; open(F1,"<","1.txt") or die "Cannot op...

C++ cin: don't show the newline

If I get some value by using getline( cin, myStr ); a newline is printed after the information the user entered - logically as he pressed enter: Please enter something: ABC <enter => \n> This text is printed out by the program and should be in the same line as before How to keep the newline after user input away? I'm using MSVC 201...

jQuery default/placeholder input text and problems with saved information

Hey Guys, I'm new to jQuery and have an annoying problem. I have some login fields that are filled with default text when the field is empty and then removed when clicked. My problem is that when the user has their username/password saved (with browser), if they return to the page the login fields are filled with the users saved input ...

How to have one PHP script launch another and capture its output?

This is a little tricky so bear with me: I have a PHP script a.php that is launched from the command line and data is provided to it via STDIN I have another PHP script b.php I want to have a.php launch b.php and capture its output. Also, a.php has to forward the STDIN to b.php Is there an easy way to do this? ...

How to check the value entered in EditText is aplhanumeric or not?

My application takes userid from user as input, the userid is alphanumeric i.e just the first character is (a-z), other part is numeric. How can I validate input of this type ( like G34555) ? ...

jQuery autocomplete for dynamically created inputs

Hi all! I'm having an issue using jQuery autocomplete with dynamically created inputs (again created with jQuery). I can't get autocomplete to bind to the new inputs. Autocomplete $("#description").autocomplete({ source: function(request, response) { $.ajax({ url: "../../works_search", ...

user input question

My program checks to test if a word or phrase is a palindrome (reads the same both backward and forward, ex "racecar"). The issue I'm having is after someone enters in "racecar" getting it to actually test. In the below code, I marked where if I type in "racecar" and run, Java returns the correct answer so I know I'm right there. But ...

Java applet - Real-time textfield input verification

I'm trying to develop an input real-time verification on a textfield in a Java applet. The idea would be to have an input field that, if empty, once the user clicks in it it would show something like "0,00". Once the user starts to press the keys, only numbers should be accepted, and it would start to fill the text like this (imagine I...

My form radio buttons don't work..

Some simple HTMl, I've added spans for styling, should I be using labels instead? It's meant to only allow one selected at a time. What am I doing wrong? I am codeblind :P JSfiddle here. Thanks. ...

SOM Algorithm Customization Matlab

I'm designing a GUI to implement SOM algorithm in MATLAB, but i'd want the user to be able to input the "No of iterations", "Initial and Final Neighborhood size" and "Initial and Final Learning Rates"....i'm using the SOM toolbox, how do i use these inputs gotten from the user to achieve my goal......any help please...rmbr files from the...

Python: how to input python-code part like \input in Tex?

I want to input code in Python like \input{Sources/file.tex}. How can I do it in Python? [added] Suppose I want to input data to: print("My data is here"+<input data here>). Data 1, 3, 5, 5, 6 ...