function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RachnaRachna 

S-control to make a field read only in edit page.

Hi,

 

I need to make a field read only and show its value in the clone page. Client is asking to go for s-control.

 

I have created an s-control and overridden the clone button.

 

This is my code:-

 

<script type="text/javascript" src="/soap/ajax/15.0/connection.js" > </script>
<script type="text/javascript" src="/js/functions.js"></script>

<script type="text/javascript">
function LoadingA()
{

var f= parent.document.createElement('form');
f.method='post';
f.target='_top';
var ch=parent.document.createElement('input');
ch.id='00NT00000017dAZ';
ch.name='00NT00000017dAZ';
ch.type='hidden';
ch.value='Cap Mkts';
f.appendChild(ch);
parent.document.body.appendChild(f);
f.submit();

}
</script>
<html>
<body id="thisBody" onload=LoadingA();>
<body>
</html>

 

On click of Clone button. The page is opened with the field value as "Cap Mkts". But its not read only.

 

Please suggest me a solution.

 

Thanks

Rachana

Cool_DevloperCool_Devloper

did u try adding-

ch.disabled = true

Cool_D