I'm using ColdFusion to handle the login function for users (see login_form.cfm below). Have to click in the username box to be able to start typing. What's the best way to define the focus to be on the username when the page initially loads?
I'm having trouble detecting if there is value in a field when the page loads and manipulating the fields label class accordingly. Below is my code. I'm using it to display the field label inline with the field, and when the user starts typing, the label is hidden. The problem I'm having is, since this is for a login screen, if the user has typed in an incorrect password, the username still remains entered when the page reloads and I see my label stacked underneath.
How can I detect if that field has a value and apply a class to the label to hide it? I don't have to have to specify each field by their ID, because I'd like to use this all over (member profile management area).
I have a form which open in a jQuery Fancybox Window. The fancybox window opens automatically when the page loads. When it loads, I would like it to set focus on the username field in the form in the Fancybox window. I have found that this must be done when fancybox is envoked, thus I have tried the below code which does not work :
I have a text field that is for a number. On page load the value is "0.0000"... I want the text field to be blank if the value is indeed "0.0000". Any suggestions on how I can validate and set the value of the text field on page load?
The online banking site I use has autofill=no set in their login form, and I recently switched from IE to Safari, which honors this. I'd like my account number to be filled in automatically like IE did (please, no comments on whether this is a good idea or not, I've already had this discussion in another group and I've decided the account number is not something I consider a big secret, since it's visible on every check -- that's what the PIN is for).
I'm trying to do this with a bookmarklet. The following works to fill in the account number and move focus to the PIN field:
Is there a way to set the focus on a form field without using focus()? I use ajax to build the form and if I try to set the focus using focus() an error is generate because of the form hasn't been built by ajax. So, it would be nice if I could set the focus() as I built the form.
I have a script that runs when the page is loaded to set focus to a field. If I have an alert immediately before I call focus() on the field everything is good. If the alert isn't there, the cursor never shows up in the field...however, it scrolls to the textbox and if I hit tab I move to the field immediately following it which would indicate I really do have focus on the field, yet the cursor isn't there so I can't start typing in the field. I thought it might be an issue with the page not being fully loaded but if that is the case why does it scroll down to the field and move to the next field after hitting tab. This is a hard one to explain and what complicates it more is that it's in an AJAX responseText environment so it's hard to nail down. Any ideas on this?
I have a single webpage that contains information on all 50 U.S. states. There are 50 links at the top to jump down to the state you want, and at the bottom of the information for each state a Back to Top link.
I'm making the Back to Top link into something more complex, and it will require three or four lines of code.
So that I don't have to repeat the code 50 times, and create a burden when I need to edit it, I want to place it in a .js file and call it x. Then below the information for each state I'll simply have:
Does calling code from a .js file 50 times slow down the page load? Which method would load faster?
I'm using JS to dynamically change the CSS attrib's of User Input Fields in a form. It works fine for text input fields but does not seem to work at all for TEXTAREAS. (IE6) Is there a tweak that might overcome this limitation? Code:
I have a set of fields(text) that are populated with data. When you tab through the fields some show focus by highlighting the entire word while others do not. What is the reason for this and can I force the highlighting?
How do I set focus on the next textfield in form when there are two characters typed in the textfield before. Like entering serialcodes for installation, you can just keep typing and the characters will appear in the next textfield when the textfield before is full.
Assuming I have the functions, "isNumber" and "isEmpty", how would I write the HTML INPUT type="text" element such that a person cannot exit the element unless they have typed in a valid number (as defined by the function isNumber) or left the field empty (as defined by isEmpty)? Thus, if they have typed in "aaa" and then pressed "Tab" to go the next element, they'd get a warning message, and be returned to the old element?
Ideally, this solution would work for both the latest versions of Firefox and IE.
When I click on a field, I put the object position in a variableEnviro["lastfocus"] = $(event.target);I call the action and a block of HTML arrived on the page, I place this text and then after, i want the focus to return to the field and I do this: