CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 show/hide file upload control

Print topic Send  topic

Author Message
xiaoming
Posted: 07/19/2004, 9:02 AM

I have a listbox and a file upload component. I want the file upload component to be visible/invisible depending on the value selected in the listbox. How can I do it? which is the best way, using JavaScript or a server-side script?

thanks in advance!

xiaoming
Stan
Posted: 07/20/2004, 3:29 AM

Hi

You can try the following solution

1. Add Client Custom Code to the OnChange event of your Listbox
2. Write following code in it

if(document.forms["_ctl0"].<formName><ListBoxName>.value != "2")
document.all["<formName><FileUploadName>"].style.cssText = "display:none";
else
document.all["<formName><FileUploadName>"].style.cssText = "";

Stan
xiaoming
Posted: 07/20/2004, 11:04 AM

this does the trick. thanks, Stan!

Now I have another question: when the file upload shows up and user select a file, then the user changes his mind and select anothe item from the list box, the file upload will hide but the file is still in the text box and will upload to the server. How to set the text in the file upload contro to NULL?

Many thanks

xiaoming

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.