Solved

setfocus and popup message boxes

Posted on 2004-04-21
5
1,645 Views
Last Modified: 2012-06-27
hi,

 can you provide me a code how to set focus and how to pop up message boxes using javascript....since i don't know much about it...


thanks......
0
Comment
Question by:joymavs
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
Comment Utility
Popup window:

<SCRIPT LANGUAGE="JavaScript">
<!--
window.open("http://www.google.com","windowname","scrollbar=no")
//-->
</SCRIPT>

<input type="text" name=text1>

function setfocus() {
  document.forms[0].text1.focus();
}

0
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 50 total points
Comment Utility
Popup window:

<SCRIPT LANGUAGE="JavaScript">
<!--
window.open("http://www.google.com","windowname","scrollbar=no")
//-->
</SCRIPT>

focus example:

<form>
<input type="text" name=text1>
<input type=button value=movefocus onclick="setfocus();">
<input type="text" name=text2>
<form>
<SCRIPT LANGUAGE="JavaScript">
<!--
function setfocus()
{
  document.forms[0].text2.focus();
}

//-->
</SCRIPT>
0
 

Author Comment

by:joymavs
Comment Utility
venkateshwarr,

thank you for your help......
0
 
LVL 30

Expert Comment

by:third
Comment Utility
<html>
<head>
<script>
function openwindow(url){
  newwin = window.open(url,'newwin','width=400,height=400')
  newwin.focus();
}
</script>
</head>
<body>
<a href="#" onclick="openwindow('http://www.google.com');return false;">popup window</a>
</body>
</html>
0
 
LVL 30

Expert Comment

by:third
Comment Utility
too late.... ;-)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now