I have a modal window with a few textboxes, one button and a few labels. I need to disable the backspace key, unless any of textboxes is in focus, if this the case, user allows to delete the text from the textbox.
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>
The default behaviour of focus() method is displaying the cursor at start of the char(In FF focusOffset is 0(zero) and anchorOffset is 0(zero)). I need to display the focus at end of char after calling focus() method.
i have a form with two buttons to submit it. One button (must be left) goes to a detail-page and the second button (must be right) goes to a basket-page. Also there is a input-field.
My problem: onLoad i give focus to the input-field. But when user submits the form with return, the first button ("show details") is executed, and you see the detail-page. But i want to give focus to the ("into basket") button, but it comes after the detail-button in source.
I cant change the buttons because it's not allowed by the designer :-( Also on load of that page, the border of the first submit button is more thick (i think 2 px) than the second (maybe 1px). How can i submit to basket, with the return-key and give them the same look?
On this page http://bit.ly/gAajO3 I have a comment form and would like the input and textarea contents to turn to blank when a user clicks on them, however this is not working for me. Would like to know what is going wrong if someone can spot it.Also on submit I want the input and textarea to be cleared if their value is 'Please type here'. This is working on the name input and textarea, however it seems the email field is not being cleared,
I have an application built in PHP which takes a code and redirects a user to the appropriate website.
This works fine when the user enters code and selects the submit button. However if the user enters the code and just selects enter on the keyboard the page refreshes, does not redirect to any URL and deletes the original entry.
Is there anyway to use unobtrusive JS to enforce the focus on the submit button as soon as the page loads?
I have created a form with malsup's Form Plugin wherein it submits on change of the inputs. However, after each submission, the form loses focus, which forces the user to click on the next input element after each input change, which is a bit annoying. Is there a way I could set the form to automatically focus on the next input element after the submission depending on which input element the form was submitted from? [code]...
My script is designed to show a simple question and the user submits the answer using onchange via the tab key. If the answer is correct the next question appears and so on. But if it's wrong there's an alert and the user stays at that question and has another go to enter a correct answer to move on. It works well as long as user gets answer right. If they enter a wrong answer I'd like that answer box to clear and be focussed (ie cursor in place). Problem is, using the tab key has already sent the cursor off to highlight the address bar! I can get it to work if each answer box has a submit button and I use onclick but I really want to change the submit function to a keystroke, pref TAB.
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.
It seems like it should be simple, but I don't see what I'm missing. Right now, the search button displays directly under my input field. I've gone through the CSS, but can't figure out where my code is forcing the button onto its own line. What am I missing? How can I bring it up to the same line?
document.[Form Name].[Field Name].focus();
If you happened to have the page scrolled above where the error field is then the page will scroll so that the error field is at the very top of the window. If you happened to have the page scrolled below where the error field is then the page will scroll so that the error field is at the very bottom of the window. Neither of these is very desirable. Any way to get the error field to the middle of the window?
If in the textarea (textarea3), the value is not "abc", and the user uses "Tab" to go to the next textarea (textarea4), it will alert an error message...and the focus will return to the textarea (textarea3) again...
It works in Internet Explorer, however in firefox it does not work? Anyway have any ideas why & how? Code:
If I use the following construct in the frame "main" for a link to an extern site:
<A HREF="http://www.any.xy" TARGET="extern">
the Browser is creating the window "extern", loading the page www.any.xy an setting the focus to "extern". But when I go return to "main" without closing "extern", a click to an other link (e.g. www.2nd_any.xy) on "main" does not setting the focus to "extern".
For setting the focus to "extern" in the second case, I have used the following construct:
<A HREF="http://www.any.xy" TARGET="extern" onClick="setTimeout('extern=window.open('','extern');fr emd.focus();',500);"> an example</A>
This construct has worked very well for a few years, but since about one year, the sesult was the same as using <A HREF="http://www.any.xy" TARGET="extern">
In this year, I have changed: win 95 --> win 2000 modem 56k --> DSL Netscape 4.5 --> Netscape 7.1
Can anybody tell me a possibility setting the focus to "extern" in the second case? Is the changing of my configuration the reason, that the construct has failed?
Neglecting the annoyance factor for a moment, is it possible to keep one browser window at the screen forefront (in front of all other browser windows) but still be able to interact with a window directly beneath it? How would this be pulled off in JS?