input

How to change form text with Jquery but keep it when filled by user?

Hi! (I hope my title is comprehensible, it was hard to sum up.) I have some script which change some text inside a form depending on the selected radio button as you can see here: http://jsbin.com/onowu/ The problem is that if some user enter some text and then click on a other radio button it will remove his text. What I'm looking f...

jquery tablesorter disables submit functionality

Hello, I've got a table which Im sorting with tablesorter (http://tablesorter.com). Within that table there is a column with submit buttons. Each table row has got a submit button. Before sorting, the buttons work great and submit a POST request which is processed by a PHP script. AFTER sorting the table with tablesorter the buttons se...

In bash, how does one clear the current input?

Suppose in bash you start writing a command like: $ rm -rf /foo/bar/really/long/path/here and then realize you don't want to execute this after all. Is there a way to clear the input with one or two keystrokes? What I have been doing lately is prepending echo and enclosing the input in quotes (Ctrl+A, echo ", Ctrl+E, ") then hitting...

How to read a single char from the console in Java (as the user types it)?

Is there an easy way to read a single char from the console as the user is typing it in Java? Is it possible? I've tried with these methods but they both wait for the user to press enter key: char tmp = (char) System.in.read(); char tmp = (char) new InputStreamReader(System.in).read (); char tmp = (char) System.console().reader().read()...

How to get multiple-line user input in Ruby?

Hey guys, I know this is a really simple question but my google-fu is failing me. I want to get multiple line user input in Ruby, as gets only gives you one line of input. I want to be able to store this multiple line input into a string so i can output the string to the end of a file. Is there a command available to do this? Thanks in...

HTML <input> size attribute not working?

I have the following element which specifies the size="15". However the rendered element, which has the size attribute, has a width that fits 25 characters and could fit 30 or so if maxlength was greater? Maxlength does limit the # of characters. <input id="txtSearch" name="txtSearch" type="text" maxlength="25" size="15" /> ...

How to show/hide input value on focus?

I see this all over the web, but was wondering if anyone has the JavaScript code for the EASIEST way to show input value on blur, but hide in on focus. Thanks! ...

Prevent default behavior in text input while pressing arrow up

I’m working with basic HTML <input type="text"/> text field with a numeric value. I’m adding JavaScript event keyup to see when user presses arrow up key (e.which == 38) – then I increment the numeric value. The code works well, but there’s one thing that bugs me. Both Safari/Mac and Firefox/Mac move cursor at the very beginning when I...

How can I place a cross-browser button within (on top) of an text input?

I'd like to create a text input with a clear button in a confined space. Like the iPhone, I want to place the button (a small x image) 'inside' the input at the far right so that a user can just click that to clear the value, instead of having to waste space beside the input. Right now I'm using a background image on the input and an in...

C/C++ add input to stdin from the program ?

Is that even possible ? Lets say that the code has a lot of scanf lines. Instead of manually running and adding values by hand when debugging, is it possible to "feed" stdin with data so that when the scanf starts reading, it will read the inputted data without any need to interact with the terminal. ...

Struts2: reading an array of input into an action

I'm trying to get an array of input into my action class but it always returns null; Here's the HTML for the input <input class="activityInput" type="text" name="sentdate[" + i + "]" value="1" /> <input class="activityInput" type="text" name="sentdate[" + i + "]" value="2" /> and here's the class for the action public class Activity...

What are the methods to check user input and prevent mysql injection?

"We should never trust user's input", this is what I read from somewhere on the web. Currently I have a web form, they enter their username and emails. For username field, how to control, check and prevent mysql injection?? Currently, in my php script I only do this: $username = mysql_real_escape_string($_POST['username']); // prevent ...

Get HTML page <input> values and names using regex on PHP

Ok, so as the title says, I have an HTML page that I fetch using libcurl (cURL inside PHP). That page has one <form> that I need to extract the <input> names and values, and I would like to do that using Regex. I'm making it using Regex because I think that's the easier way. If you think I shouldn't use regex, but something like xpath, s...

How can I apply a background image to a text input without losing the default border in Firefox and WebKit browsers?

For some reason most modern browsers will stop applying their default input border style to text boxes if you give them a background image. Instead you get that ugly inset style. From what I can tell there's no CSS way to apply the default browser style either. IE 8 doesn't have this problem. Chrome 2 and Firefox 3.5 do and I assume oth...

Is any one aware of windows event to trap the mouse and keyboard input

I want to trap windows mouse and keyboard input with the help of event given by windows for detecting system idle or not in C++. Two things I have tried: 1. Hooking concept, but as antivirus might not allow it and also CPU usage increases if we use hooking. 2. GetLastInputInfo() which also eats CPU usage about 50 % Anyone can tell me i...

Need some direction regarding windows service

Hi all, I need to do the following and i was wondering if i could get some of your input. Every night there is a file created at a certain location (on a ftp server). What i need to do is download this file and import it into a remote sql server via web services. I also need to have the ability to re-run the import process (download fil...

*SOLVED NON-PROBLEM* <element>.focus(): how to make it work in both IE6, IE7 and IE8?

EDIT: This turned out to be a local problem in my IE6/7/8 test setup. The problem is a non-issue on a clean default install of IE, no matter what version. You can stop reading now. :) I'm writing a rich web application where I display a popup panel containing a simple text input field. I need to focus this text field immediately, so the...

How to keep some input text removed by jquery when going back with browser?

Hi! I have some bug with the following page: http://jsbin.com/agedu/ Source code with some comments: http://jsbin.com/agedu/edit The problem is that when typing something and doing the query to display search results, if I go back to the search page in my browser (Firefox 3.5 but it's the same thing with IE8) there isn't my search term...

Grouping fields in ASP.NET MVC

I am working on an ASP.NET MVC application which has a model for a business, linked to another model (business trading hours) in a one-to-many relationship. When creating this entity we have a form where we would like to provide a fixed set of the BusinessTradingHours entities, so I have used something like the following (kind of what I...

Submit button causing layout issues

Hi all I have 2 buttons , one being a image submit button and the other just a standard link button. The layout issue is that the image submit button pushes the other button beneath it. If i take out the form tags the 2 buttons remain side by side which is the way i wish for it to be. any suggestion on how to make my buttons side by s...