This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Ajax Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Ajax Problem" Watch "Ajax Problem" New topic
Author

Ajax Problem

Raja ji
Greenhorn

Joined: Dec 19, 2005
Posts: 16
Hi All,

How to use OnChange event on file(Browse)

Actually there is no file tag in ajax , then how to use OnChange event on file(Browse) .

My requirement is that when i select a file from a drive by using browse then some text fields should be filled up .

I want to use ajax here but there is no related tag to do so.
Please help me .

Thanks in Advance,
riyasat
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This could be problematic. When you add an <input type="file"> tag (or an <html:file> tag that renders to the same), the browser automatically handles the browse function using operating system APIs to display the browse dialogue. You have no direct control over this, and therefore can't insert any ajax calls into this process.

About the only workaround I can think of would be to write your own applet to handle the file browse and selection process and call that instead of using the <input type="file"> tag. You can then control what happens when a file is selected.


Merrill
Consultant, Sima Solutions
 
Don't get me started about those stupid light bulbs.
 
subject: Ajax Problem
 
Similar Threads
AJAX Conditionally Render Components
Help with value change of select tag on jsp page
The Onchange Event is Not Fireing for My Input Tag
how to h:inputHidden to pass value to server in AJAX way
html:select AJAX question