Question
How to Set Focus to Web Form Controls By Using Client-Side Script?

Answers

<script language="javascript">
function SetFocus()
{
// W3C approved DOM code that will work in all modern browsers
if (document.getElementById)
document.getElementById('txt2').focus();
else
// To support older versions of IE:
if (document.all)
document.all("txt2").focus();
return false;
}
</script>
<body MS_POSITIONING="GridLayout" onload="SetFocus()">
<form id="Form1" method="post" runat="server">
Enter 1:
<asp:TextBox ID="txt1" Runat="server" Width="50" />
<br>
Enter 2:
<asp:TextBox ID="txt2" Runat="server" Width="50" />
<br>
<asp:Button id="Button1" runat="server" Text="Button1"></asp:Button>
</form>
</body>
Refer Sample IE Code   Your Comment




More Software,Focus Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q Can you work under pressure or within a tight deadline?
  • Q The lowest temperature in the night in a city A is 1/3 more than 1/2 the highest during the day. Sum of the lowest temperature and the highest temperature is 100 degrees. Then what is the low temp?
  • Q What is digital marketing?
  • Q In Minnesota woman can get 30 days for impersonating who
  • Q How do you manage your staff?
  • Q Which of the following would be the BEST method for ensuring that critical fields in a master record have been updated properly? A. Field checks B. Control totals C. Reasonableness checks D. A before-and-after maintenance report
  • Q During a given week an author spends 1/4 of his time preparing first drafts, 3/8 of his time editing the drafts and the rest of the time in preparing final drafts. If he works 48 hours during the week, how many hours did he spend in preparing final drafts?
  • Q Who regulates the insurance industry in India?
  • Q Are there additional requirements for quality policy?
  • Q What is form factor ? what is its value for sinusoidal wave? What is its significance?
  • Q Define poikilocytosis?