Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2005, 02:54 PM
mh mh is offline
Authorized User
 
Join Date: Mar 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default disabling the file input element

I currently have my file input element disabled unless "2" is selected from the dropdownlist and a button is clicked. Once "2" is selected and the button is clicked, the file input element should be enabled. So far this is what my code looks like:

<head>
<script>
function NewWindow()
{
if (document.getElementById("dlstep").value == "2")
     {
     document.form1.txtCvsFile.disabled = false;
     }
return false;
}
</script>
</head>

<INPUT id="txtCvsFile" name="txtCvsFile" style="WIDTH: 317px; HEIGHT: 22px" disabled type="file" size="33">

This is all in my aspx file. And the error I get is:

document.form1.txtCvsFile is null or not an object.

Can someone please tell me what I'm doing wrong or what I should be doing? Thanks.

 
Old April 9th, 2005, 03:55 PM
Authorized User
 
Join Date: Jul 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Mayur52o
Default

try document.getElementById("txtCvsFile").disabled = false;
 
Old April 11th, 2005, 10:11 AM
mh mh is offline
Authorized User
 
Join Date: Mar 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling Simple File Sharing in Windows XP. firblazer BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 April 14th, 2008 12:10 PM
file form element nerssi Javascript 3 January 18th, 2005 06:14 AM
Add Mask To Input Element ritag HTML Code Clinic 4 July 20th, 2004 03:33 PM
Multiple file input single file output.... jdm_mboy Biztalk 1 July 2nd, 2003 03:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.