homepage Welcome to WebmasterWorld Guest from 50.16.36.153
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

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

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved