|
What is a JavaScript or jQuery solution that will select all of the contents of a textbox when the textbox receives focus?
Started by Jon Erickson on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Document).ready(function() { $("input[type=text]").focus(function() { $(this).select(); } ); });
<input type="text" onfocus="this.select()" />
$(document).ready(function() { $("input[type=text]").focus().select(); }); .
|
|
I am running a Debian Lenny server with two network interfaces. The first interface eth0 is connected to the LAN and receives an IP-address from the DHCP-server on this LAN. The second interface eth1 is connected directly to a NAS, on this NAS a DHCP ...
Started by zx883 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
This is exactly how the information provided by the DHCP server is used .
It receives an IP address via DHCP.
|
|
I'm new with Java and just learning... but how would you write a program that receives an ASCII code and displays its character. For example, if the user enters 97,the program displays character a.
Started by Holly on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can then explicitly cast that into a char:
String asciiCode = "97"; (char)Integer.parseInt(asciiCode); .
Int i = 97; char c = (char)i; //c will contain 'a'
Use Integer.parseInt(string) to turn that 97 into an integer .
|
Ask your Facebook Friends
|
In my Rails app, I have a script that updates some records in the database. When I send a SIGTERM to kill the script, it occasionally receives that signal while ActiveRecord is executing a query. This leads to an ActiveRecord::StatementInvalid exception...
Started by Readonly on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
To do the database update, and signal the parent to... .
It sounds like this "script" is external to the Rails app ( script/runner or similar?), so perhaps you can decouple the "signal handler" and "worker"? Eg can you fork a child process/thread/fiber/.. .
|
|
This is a followup question to this question:
select all contents of textbox when it receives focus (Javascript or jQuery)
basically I am using a textbox in conjunction with the jQuery masked input plugin
When the masked input textbox receives focus i...
Started by Jon Erickson on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
$("input[type=text]") .focus(function() { var mask = "99/99/9999"; $(this).unmask(mask).select....
Hey Jon, not too sure about the performance of this, but this should work:
$(function() { // Contents of textboxes will be selected when receiving focus.
|
|
Hi. I got a JTextField , and to that field I have added a Keylistener . Inside the keyPressed method, I ask the method to print ( System.out.println ) whats inside the JTextField .. If I hit a letter, it seems as the Keylistener receives this key-hit ...
Started by Johannes on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
See the original here
((AbstractDocument)textField.getDocument()).setDocumentFilter(new UppercaseDocumentFilter()); class....
Not the prettiest source and it's not 100% correct, just showing how it works .
Use a DocumentFilter to alter the text as it comes in .
|
|
I ported most of my app to OTP behaviors, but I'm stuck. I can't figure out how to do selective receives using a gen_server. If none of the callback function clauses match a message, rather than putting the message back in the mailbox, it errors out!
...
Started by mwt on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
There is no reason you can't implement your own service which handles... .
The gen_server while doing the selective receives, then it could be an idea to start a process as well block for you which prevents you from using selective receives.
|
|
I have a page that allows the user to download a dynamically-generated file. It takes a long time to generate, so I'd like to show a "waiting" indicator. The problem is, I can't figure out how to detect when the browser has received the file, so I can...
Started by JW on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Start the waiting ....
If you're download a file, which is saved, as opposed to being in the document, there's no way to determine when the download is complete, since it is not in the scope of the current document, but a separate process in the browser .
|
|
I've seen many examples of this (clickatell.com among them) that only support text in the USA. I need my application to receive images/videos from text messages (MMS?) from users. The web app needs to receive a way to identify the user (phone number) ...
Started by Chris T on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I believe that's standard (as in all carriers....
There may (or likely is) some MMS gateway that will allow your app to appear as another phone number (or short code), but I'm pretty sure you can just have people send the MMS message to an e-mail address .
|
|
I have a method that I want to test which expects an IEnumerable<T> as a parameter.
I'm currently mocking the contents of the IEnumerable<T> as follows (Using Moq):
var mockParent = new Mock<ICsvTreeGridExportable>(); var mockChild =...
Started by Jamie Dixon on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Var mockParent = new Mock<ICsvTreeGridExportable>(); var mockChild = new Mock<ICsvTreeGridExportable>(); TestMethod(new[] { mockParent.Object, mockChild.Object });
Arrays... .
I would just create an array using the collection intialiser syntax .
|