homepage Welcome to WebmasterWorld Guest from 54.205.106.111
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Change image once hidden field is populated
el_roboto




msg:3618928
 10:35 am on Apr 4, 2008 (gmt 0)

In my form users are required to select a file from the server, they do so by clicking a browse button which opens a file browser.

Once they have selected a file, the path to the file is returned to a hidden field as its value.

When a file has been selected I'd like this browse button image to change to show the user that their selection has been logged.

I've created a function which checks the value of this hidden field and providing it isn't blank, will change the src of the image button. This function is working ok.

What I'm trying to figure out is where to call the function so it checks the hidden field at the right time. I've tried giving the hidden field an onblur="" and calling my function here but this isn't working.

Does anyone have any suggestions?

 

Fotiman




msg:3619162
 3:14 pm on Apr 4, 2008 (gmt 0)


Once they have selected a file, the path to the file is returned to a hidden field as its value.

At that time you should call your function. You won't be able to use the the onblur or onchange methods of the hidden field, as they won't be triggered by changing the value via JavaScript.

el_roboto




msg:3619177
 3:35 pm on Apr 4, 2008 (gmt 0)


Thats was exactly the problem.

Resolved now anyhow, thanks

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved