IDMIntranet eXchange 
[ Home | Post | Register/Awards | Find | F A Q | Archive ]

 Home/Articles
  •  Recent Tutorials
  •  Recent Features
  •  Top Twenty Articles
  •  Oldies But Goodies
 ITAdvisor
  •  News & Analysis
  •  Security
  •  Intranet Buzz!
  •  Intranet Talk
  •  Intranet Corner
  •  CaseStudies/ Departments
 Intranet Development
  •  WirelessEnterprise
  •  Getting Started
  •  JavaScript
  •  VBScript
  •  HTML/DHTML
  •  XML
  •  ASP/IIS
  •  Perl
  •  PHP
  •  CascadingStyleSheets
  •  Dreamweaver
  •  FrontPage
 Information Management
  •  Content Management
  •  Collaboration
  •  Portals
  •  ASPs
 Intranet Resources
  •  Intranet FAQ
  •  Discussion Board
  •  Jobs Board
  •  Events Calendar
  •  Intranet Books
  •  Tools of the Trade
  •  Glossary
 Archive
 Site Map

Modern Daze: Comics Page

New

Free Newsletter!
 
Privacy Policy

Search IDM:


Hot Intranet eXchange discussion board Threads
º  masking in javascript
º  Can pseudo-url in image maps work? -
º  How do I make these into a real type?
º  Access and Intranet
º  Help with a plan for an Intranet
º  Frames problem
º  Opening Word and Excel Documents from Intranet
º  asp file not running in local intranet environment
º  Best Document Management / Collaboration software
º  readonly text entry
º  Small company intranets
º  Forcing IE to open Excel Workbooks in a New Instance
º  Criteria for content management systems/products
º  Best Document Management / Collaboration software
º  How to have How to have an image follow the mouse cursor
º  Creating Hyperlinks - Database driven
º  Table background..
º  MS Access returning multiple rows

More Intranet eXchange Highlights

*  Articles Elswhere on Internet.com

Re: readonly text entry


[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]


Posted by pdii on August 31, 2000 at 1:48:10:

In Reply to: Re: readonly text entry posted by Charls on August 23, 2000 at 17:31:8:

I would do it like this:
Suppose the name of the checkbox is 'cbox' and the name of the text field is 'txtfld'. First, we need to check to see if txtfld is readonly. If it is readonly (that is, cbox is checked), then we would blur() out of the field, in effect turning it into readonly. If cbox is not checked then no big deal the user can edit the field.
The code would look something like this:
function status() {
if (document.forms.cbox.checked) document.forms.txtfld.blur();
}
<form><input type="checkbox" name="cbox">
<input type="text" name="txtfld" onfocus="status()"></form>

The form will only return to the CGI 'successful' objects, that is object that has been changed. So , if txtfld did not get changed then it will not be returned to the CGI. You could force a value on txtfld with document.forms.txtfld.value =
whatever" in the status() function to ensure that it will be returned to the CGI if the user does not enter anything.



Follow Ups:



Post a Followup

Name:     
E-Mail:   
Subject:  
Message:

Optional Link URL: 
Link Title:        

      



[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]