Ajax and Onfocus Event???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rasmita
Forum Newbie
Posts: 11
Joined: Wed Nov 19, 2008 5:38 am

Ajax and Onfocus Event???

Post by rasmita »

When any new user uploads image, while the cursor is in the input box from where the image is to be uploaded, I have to give some instructions about the image upload. How can I take the help of ajax and onfocus here??? Can anyone help me, please???
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Ajax and Onfocus Event???

Post by califdon »

rasmita wrote:When any new user uploads image, while the cursor is in the input box from where the image is to be uploaded, I have to give some instructions about the image upload. How can I take the help of ajax and onfocus here??? Can anyone help me, please???
Yes, you can have an Ajax call in the onfocus event of the input box, but are you sure you need to use Ajax? What is it you need to retrieve from the server? If you only need to show a pop-up window or something, with instructions, that doesn't require Ajax or the server. If you indeed need to fetch some data from the server, depending on what the user has input somewhere else, you need to code all of the actions to create the pop-up including the new data, in the function defined in your Ajax call. I wouldn't try to explain how to code Ajax, but there is a lot of info on the web, such as http://www.w3schools.com/Ajax/Default.Asp.
Post Reply