Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Forms
| Search | Today's Posts | Mark Forums Read
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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
  #1 (permalink)  
Old August 22nd, 2003, 06:47 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to disable html Form instead Form Elements

hi guys is it possible to disable all form element once?
i mean can i disable form directly instead form elements so that
all form elements inside form will disable?

Thanks in advance
hrishikesh


  #2 (permalink)  
Old August 24th, 2003, 01:41 AM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, MM, Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

You can't put a "disabled" attribute in the form tag but you can put the following into your code and call it using the body tag's onLoad event.

<script language="Javascript">
  function disable() {
    var limit = document.forms[0].elements.length;
    for (i=0;i<limit;i++) {
      document.forms[0].elements[i].disabled = true;
    }
  }
</script>

Cheers!


Marlon Villarama
Support Team
Web Burner Hosting
marlon@webburner.com
www.webburner.com
Toll-Free: 877-535-2876
  #3 (permalink)  
Old April 27th, 2004, 01:48 PM
Registered User
 
Join Date: Apr 2004
Location: Boston, MA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default


What if I want to disable it on some condition.
Can anyone please let me know how we can do it
ie if a flag is true then disable the whole form
else no.

Thanks,
Gayatri

Gayatri
  #4 (permalink)  
Old April 27th, 2004, 01:53 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Gayatri,

It is possible to assign the function to an event. Just include the function posted by Marlon and assign it to an event like this:

document.onclick = disable;

Let me know if there is a different kind of condition you mean.

HTH,

Snib

<><


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable form design ? sms Access 2 May 19th, 2008 02:06 AM
Converting an HTML Form to ASP.Net Form k_alidxb75 ASP.NET 1.x and 2.0 Application Design 0 November 30th, 2006 03:26 AM
Enable/Disable Form Elements Question kwilliams Javascript 4 February 28th, 2006 11:28 AM
Looping through form elements trekmp VS.NET 2002/2003 1 May 11th, 2004 11:01 AM
Disable Form Elements Hotwax ASP.NET 1.0 and 1.1 Professional 2 October 31st, 2003 08:11 AM





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