Page 1 of 1

Ajax and Onfocus Event???

Posted: Mon Dec 01, 2008 7:27 am
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???

Re: Ajax and Onfocus Event???

Posted: Mon Dec 01, 2008 5:15 pm
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.