Click to See Complete Forum and Search --> : Window self focus! Can't handle text fields and list menu?


Anuruddha
09-20-2003, 03:48 AM
My pop up window is self focus mood. I found a script for handle text fields but still cant handle list boxes. Would appreciate if anyone can help me!

Source

<html>
<head>
<script language="javascript">
var GiveFocus="FALSE";
function CheckFocus()
{
if(GiveFocus == "FALSE")
{
window.focus();
}
else{
return;
}
}

function Change(obj)
{
GiveFocus="TRUE";
CheckFocus();
obj.focus();
}
</script>
</head>
<body onBlur="CheckFocus()">
<form name="myform">
<input type="text" name="inputone" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<input type="text" name="inputthree" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<input type="text" name="inputfour" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<input type="text" name="inputfive" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<select name="select">
<option>asdsad</option>
<option>Item one</option>
<option>imtem two</option>
</select>
</form>
<input type="radio" name="radiobutton" value="radiobutton">
<input type="checkbox" name="checkbox" value="checkbox">
</body>
</html>

Khalid Ali
09-20-2003, 07:25 AM
it seems like you want to keep focus on some items,but your question is vague,please elaborate

Anuruddha
09-20-2003, 08:21 AM
My question is: I have pop up window that I need to keep it focus all the time. That’s way I used: in the body tag onBlur="self.focus()

I have some text fields and list box on the popup window and user can select category from the pull down menu and enter relevant info to the text fields.

My problem is I can't select category from select box; when click the arrow pull down menu is suddenly disappearing. AND I cant type my data on the text field.

I found JavaScript solution for the text fields (now i can type on the textfields)but pull down menu is still not pulling down.


I think now my problem is undustandable.

MANY THANKS!!!


This is sample html file of my pop up page:
<html>
<head>
<script language="javascript">
var GiveFocus="FALSE";
function CheckFocus()
{
if(GiveFocus == "FALSE")
{
window.focus();
}
else{
return;
}
}

function Change(obj)
{
GiveFocus="TRUE";
CheckFocus();
obj.focus();
}
</script>
</head>
<body onBlur="CheckFocus()">
<select name="select">

<option>Please select >></option>
<option>asdsad</option>
<option>Item one</option>
<option>imtem two</option>
</select>
<form name="myform">
<input type="text" name="inputone" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<input type="text" name="inputthree" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<input type="text" name="inputfour" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
<input type="text" name="inputfive" onClick="Change(this)" onBlur="GiveFocus='FALSE';CheckFocus();"/>
</form>
<p>&nbsp;</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</body>
</html>

Khalid Ali
09-20-2003, 10:22 AM
thats because of you are setting focus to the body on the page,you will have to re think your logic and see what is exactly you intentd to do and then set the focuses for the elements