What Tag To Input To Focus A Frame?
Dec 17, 2003If there are 2 frames on a page, how would I go about focusing one frame so that the address bar shows the URL of the frame that is focused?
View 2 RepliesIf there are 2 frames on a page, how would I go about focusing one frame so that the address bar shows the URL of the frame that is focused?
View 2 RepliesI have a frame set (as per MS FrontPage 2000). It has a contents and a main
frame. The contents frame has a menu bar written with with javascript (in
the context of a table). In IE6.1 everything works fine as it also does in
firefox if I call the contents frame directly (i.e. outside of its
frameset). However, if I call my main page (index.html) which invokes the
frame set, the contents frame javascript menubar onmouseover function
doesn't seem to work though if I reload the contents frame directly it then
does. Code:
The situation is this:
+Must use frames (no iframes)
+the input field resides on another page of a different server not controlled by me but is linked via the frame. Thus the problem - I cannot change any code on the frame page.
+the input field is an ID field that once it is entered, it should post by returning the results
Problem: I need to autofill the value into the input field and then post the form. But the form resides on an outside server. How can this be done?
Efforts to date:
1) I have created a separate button that tries to autofill the value after being pressed. Unfortunately, it only works in a non-frame - I cannot seem to reference the form value inside the frame.
2) I tried to pass the value as form.input.value=xxx, but this just seems to be ignored.
I'd like to have the cursor in the login form's username input text field when users load the login page. It works fine with the following implementation:
<body onload="document.login.username.focus();">
<form name="login" method="post" action="<?=$PHP_SELF?>">
<input type="text" name="username" onLoad="self.focus();">
The problem is that the input field's name cannot be simly "username",
because it posts an element of an array, therefore the name is
"upd[username]".
Unfortunately when the above implementation is modified according to
the input field's name, I receive a script error.
<body onload="document.login.upd[username].focus();">
<form name="login" method="post" action="<?=$PHP_SELF?>">
<input type="text" name="upd[username]"
onLoad="self.focus();">
I assume I'd need to escape 'upd[username]' on the 'body onload' line
somehow, but I don't know how.
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've written the following function who works great in IE
function OnlyCharacter(tekst)
{
if (tekst.length == 1)
{
if (tekst >= "A" && tekst <="Z")
{return true}
}
window.alert ("Only uppercase");
form1.Sectie.focus();
}
But in Netscape or Mozilla I can't bring back the focus on the field
(Sectie) when the input is not correct
I've tried the following :
1) var box;
box = document.forms[0].elements[1];
box.focus()
2)document.getElementById("Sectie").focus();
3) document.form1.Sectie.focus()
but nothing seems to work.
How must I do that in Netscape and/or Mozilla?
I would like to clear a search input field on focusout(), without extra button for reset or something similar. I filter list when users type something in search field but when they click outside the form, search filed should be cleared.
View 3 Replies View RelatedI have some accordions within jquery tabs. Within some of the accordions I have input boxes, select boxes etc. I have no issues with the select boxes, but with the input boxes clicking into them does not give focus to them and I cannot type anything in. However, right-clicking a couple of times do then allow text to be types in.
Example section from accordion with input that cannot get focus:
<h3><a href="#">Search by a reference</a></h3>
<div>
<fieldset>
<label for="invoiceRef">Invoice Reference</label> <input type="text"
[Code].....
I have the following html
<div id="xx">>
<html:form ....>
<html:text property="title" value="" styleId="forum_newthread_title" />
</html:form
</div>
The xx div is opened as a overlay using jQuery.overlay plugin. Now this works great. But when this form is opened i want to give focus to the first html:text field.
[Code]...
I would like to test if a particular input field has focus before allowing an event to take place. How can I do this, I tried using:
if ($('input#div_name').focus()) { do_something... }
But I guess many of you already know that in this case all it did was transfer focus to input#div_name - Which is not what I wanted to do - I wanted to only test if input#div_name had focus.
The function below will automatically move to the next input field in the event that a user hits the enter key. I'm trying to modify it so that it moves to the next input field with a tabindex set. So, in the example below, it'll move to the next input field chronologically, instead of how they're ordered on the page itself:
<input type="text" name="a" tabindex="1" />
<input type="text" name="b" tabindex="3" />
<input type="text" name="c" tabindex="2" />
how I can do it?
Code:
$('input').live("keypress", function(e) {
/* ENTER PRESSED*/
if (e.keyCode == 13) {
/* FOCUS ELEMENT */
[Code]....
I tried to create a new text input once the last text box gets focus. But I cant even type in them because every time it gets focus a new text input is created! I really dunno what to do.
<html>
<head>
<script type="text/javascript">
[code]....
Does anyone know how to do the input focus fade in and fade outs that is seen at Apple's mobile me website at [URL] I would love to implement it in my own login box.
View 2 Replies View RelatedI have an input (type="text") with some default text telling the user to enter something in the box. The input tag includes an onmousedown event which runs javascript function to clear the default text so the user can start entering their own text.This setup behaves in two possible ways, one is good and one is bad:
Good: If the user clicks inside the text box, but after the default text, the text gets cleared and the cursor shows up at the beginning of the text box.
Bad: If the user clicks inside the text box, but directly on the default text, the text gets cleared, but the cursor is not displayed and the text box does not have the focus. In order to start typing, the user must click on the text box again.
So my question is: If the cursor is inside a string of text which gets cleared, is there a way to reinstate the cursor and the text box focus?
I had a request recently for a script which moves from input to input using the up and down arrows. It should skip buttons and password fields, and it should loop from the first element to the last. Code:
View 2 Replies View RelatedTo sum up this issue, I have a parent page, which holds some values in hidden input fields passed to them from the url. On this page, I have an iframe with a form in it, to which I want to pass values from these hidden fields to be displayed for the user in the iframe form. In IE, it works. To accomplish this, im just simply doing a <body onload="GetInput()">. The GetInput function does the following, but for about 10 fields:
Fnamefield=document.getElementById('firstname').value = parent.document.getElementById('firstname').value; Thats it. Once the page loads, i see my values. In firefox it does not work. I know the hidden fields are getting their values, but thats as far as it makes it. I have tried calling the GetInput function after the form is written out and not in the body tag, which still works for IE, but not FF.
I'm having a problem returning focus back to an input field in Netscape. The
code works in IE and Opera but not in netscape6+.
Basically I have a function that is called upon exiting a form field, if the
value validates properly it returns true and calls another function, if it
doesn't validate the field it returns false and I want to give focus back to
the sender and highlight all of the text in the field.
The problem is that while IE and opera return the curser back to the field -
Netscape ignores the focus statement (I still can't find any examples as to
how to return the curser and highlight the text in the field). Code:
I'm trying to make a form with a postal code input. But there are 6 input fields within a div container. When some one types just one letter they automatically go to the next input field this continuing until they reach the last input area.
View 2 Replies View RelatedI have a form with a certain number of elements, i want it to at first only display the first, then when i deselect that element the next one is shown and focus moved to that and so on until the end of the form. Im new to jQuery and just
View 1 Replies View RelatedBasically I want to prevent a user from moving to another field if the current one is invalid (non-numeric).I've tried a few things that I though would do the job, I've also tried using the change event with the last line (resetting the focus to the current element) but no dice.
jQuery('.setupprice, .monthlyprice, .quantity','#config_dialog').live('focusout',function(e)
{
var val = parseFloat(jQuery(this).val());
[code].....
In the code below I am trying to give focus to the 'input.qualifier' element when one of the options under 'select.qualifier' is chosen. [code]...
View 1 Replies View RelatedI have just started using jQuery and getting familiar with the syntax. I have a simple function I want to run that will add a "focus" class when a textbox receives focus, and remove it when it loses it. I have the following code:
$(document).ready(function () {
$("input[type='text'], input[type='password']").focus(function () {
$(this).addClass("inputFocus");
alert('Handler called');
[Code].....
The code appears to run normally, but I don't see any alerts pop up when I give focus to a textbox or leave it. I have examined what jQuery is doing, and it selects the dozen or so textboxes on my page correctly and iterates through them, but afterward I don't see any "onfocus" or "onblur" events as being attached in the IE Dev Tools.
These textboxes are all hidden on the page to start with, but are accessible through the DOM.
Is there a way to give an input or textarea field the focus and set the focus to begin right at the end of the current text in the field?
View 3 Replies View RelatedHow can I make it so that when I click a link, my input box now has a cursor / focus set?
View 2 Replies View RelatedThis code works fine in Firefox and Opera, I can see that it put focus
on the correct input in IE, but by the time the page has loaded
completely it loses focus.
The first time you enter the page it works fine in IE too, but if you
click a link which gives the input a value after reloading the page the
above happens. Code:
At the moment, I have datepicker working on my page, and I really like it. When I tab through my form, and the date field receives the focus, the calendar opens. I pick a date and it closes. but some times I'm tabbing backwards through a form, or tabbing over a date field that already has a date in it, and just want to "tab on by". Datepicker open when the date field receives the focus, but does not close when the date field loses the focus.
View 3 Replies View Related