Welcome to WebmasterWorld Guest from 54.205.74.11

Forum Moderators: open

Change image once hidden field is populated

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

5+ Year Member



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)

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




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)

5+ Year Member




Thats was exactly the problem.

Resolved now anyhow, thanks

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month