473,659 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

focus my edit box when page loads

How can I (in PHP) have my first edit box focused and ready for keyboard
input when the page loads
(yes, I am new to php :-D )
Jul 17 '05 #1
3 2198
PHP is a server side language. You need to do this with a client side
language like JavaScript.

David wrote:
How can I (in PHP) have my first edit box focused and ready for keyboard input when the page loads
(yes, I am new to php :-D )


Jul 17 '05 #2
David wrote:
How can I (in PHP) have my first edit box focused and ready for keyboard
input when the page loads
(yes, I am new to php :-D )


Nothing to do with PHP ...

It's typically done via client-side script, as follows:
Somewhere in the <head> add:

<script
<!--
function focus_on_start( )
{
document.NAMED_ FORM.NAMED_TEXT BOX.focus();
}

<body .... onLoad=focus_on _start()>
....
...
<form name='NAMED_FOR M'...>
<input size='50' name='NAMED_TEX TBOX'...>
....
...
...
etc.

And that should do it. won't work on systems with script disabled. There
is no way around that.
good ruck!
mark.

--
I am not an ANGRY man. Remove the rage from my email to reply.
Jul 17 '05 #3
thanks!

"Mark" <mw@ANGRYLanfea r.com> wrote in message
news:PO******** ************@nv enture.com...
David wrote:
How can I (in PHP) have my first edit box focused and ready for keyboard
input when the page loads
(yes, I am new to php :-D )


Nothing to do with PHP ...

It's typically done via client-side script, as follows:

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1152
by: Klein | last post by:
I have an application which can load ms word documents and save them. The application has a main form with a file menu, an edit menu and a tool bar. I have a DocumentControl(usercontrol) defined which handles loading the word document into itself. The flow of events are as follows: Main Form -> New -> Creates an instance of DocumentControl -> Loads Word document into DocumentControl (by passing itself as a window handle). The new...
0
1194
by: JoRo | last post by:
I am working on a project where I want a very user-friendly interface. I have a datagrid of categories that uses the EditCommandColumn to do in-line editing of the category name. On the page is also a textbox field with an "Add" button to create new categories (This is outside of the datagrid). When the page first loads I use Page.RegisterHiddenField("__EVENTTARGET", "btnAdd");
1
1474
by: test test | last post by:
Hi, How can I set focus to a particular textbox on an aspx page in vb code? My problem is caused by the page updating when a user clicks a command button and I execute code (like updating a price when you click "Calculate" button, etc.). The button they click and the "Total" field is down toward the bottom of the web page and when the page updates, it resets to the top like you just opened the page. I have searched on the "Focus"...
5
5306
by: Kathy Burke | last post by:
Hi, I've used the following javascript structure in other places in my asp.net app, but for this one the pop-up window still goes to the back and doesn't get the focus. button onclick event: Response.Write("<script>var w=window.open('ECN.aspx', 'ECN', 'width=650,height=550,top=50,left=100,toolbar=no,menubar=no,resizable=ye s');w.focus();</script>") Any ideas how to make this work or what could be causing the behavior?
11
7333
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz 1.7.12 (linux kubuntu). It does work with konqueror. It seems to work with firefox on windows but not with IE (not completly sure though).
1
2823
by: Mike | last post by:
I have an intranet page which has an iframe which links to a number of different possible .NET pages. In one of the embedded .NET pages (and soon to be others) we want to be able to capture keystrokes in order to link to other apps. we do this by setting document.onkeydown to a function which handles the various possibilities.
1
2552
by: Dan Sikorsky | last post by:
My ASP.Net 2.0 FormView has an EditItemTemplate, an InsertItemTemplate and an ItemTemple. When the page first loads, the ItemTemplate shows with an Edit button. If the user clicks the Edit button, the postback loads the EditItemTemplate, but with NO focus on any control on the EditItemTemplate. How can I set the focus to the first textbox on the EditItemTemplate when the page postsback? -- Dan Sikorsky, MSCS BSCE BAB
9
2714
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
2
2541
by: ruthie | last post by:
Hi, I have a gridview with edit option. If the user chooses to edit the row and then press the Cancel button - I would like the focus to return to the chosen row. Someone has any idea how to implement it? Thanks. Regards,
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.