- How can I create a Read-only field?
- Posted by Simon on September 17th, 2004
In one of my forms there is a textfield that should be either enabled
or disabled, depending on the value of a picklist.
With a Jscript in the onChange event I can do this, but how can I make
sure the textfield still is disabled/enabled when I re-open the form?
It should be some procedure that is called when loading the form, but
how do I create such a procedure, and how do I insert it in form.load?
I hope somebody can help me with this, and that he/she can explain it
in newbie-terms...
Thanks in advance,
Simon
- Posted by Chris Mims on September 22nd, 2004
Hi Simon,
I'm trying to do the same - here is some code from a system where the
Read-Only is working:
------------------------------------------------------------------------
}catch(e){}}document.onreadystatechange=fnStartIni t; function
fnStartInit()
{
crmForm.elements["CFSdirectcustomername"].readOnly= 1;
crmForm.elements["CFSdirectcustomerid"].readOnly= 1;
if("complete" == document.readyState) { } }function
DoNothing(){try{
----------------------------------------------------------------------
this was "stitched in" to the xsl file for SalesOrder
(E:\Inetpub\wwwroot\_xslfiles\1088_Create.xsl), so that 2 custom fields were
read-only....
(I'm still working on figuring this out, but thought maybe you could work
with this)
Chris
"Simon" wrote:
- Posted by Paul on September 24th, 2004
Hi!
Another solution to this I found useful was to open the appropiate XSL-file
(e.g. C:\Inetpub\wwwroot\CRM\_xslfiles\2_Update.xsl for Contacts or 1 for
Accounts) and edit the input-tag there
For instance this is what I did with one of my custom fields:
<input tabindex="105" type="text" name="CFSNyarbgiver"
maxlength="50" readonly="yes">
After this I just run IISRESET
"Chris Mims" wrote:
- Posted by Matt Parks on September 24th, 2004
One risk to editing the XSL files directly is that the XSL files will be
overwritten the next time someone Publishes that object.
Matt Parks
MVP - Microsoft CRM
----------------------------------------
----------------------------------------
On Fri, 24 Sep 2004 02:23:09 -0700, "Paul" <Paul@discussions.microsoft.com>
wrote:
Hi!
Another solution to this I found useful was to open the appropiate XSL-file
(e.g. C:\Inetpub\wwwroot\CRM\_xslfiles\2_Update.xsl for Contacts or 1 for
Accounts) and edit the input-tag there
For instance this is what I did with one of my custom fields:
<input tabindex="105" type="text" name="CFSNyarbgiver"
maxlength="50" readonly="yes">
After this I just run IISRESET
"Chris Mims" wrote: