Welcome to WebmasterWorld Guest from 54.146.5.43

Forum Moderators: open

Message Too Old, No Replies

Change image once hidden field is populated

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

Junior Member

10+ Year Member

joined:Feb 14, 2007
posts:92
votes: 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?

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

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:5003
votes: 20



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.

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

Junior Member

10+ Year Member

joined:Feb 14, 2007
posts:92
votes: 0



Thats was exactly the problem.

Resolved now anyhow, thanks