You can simply override onBeforeHtmlOutput to add "disabled" mark to tag:
<INPUT TYPE=TEXT NAME=F1 DISABLED>
But this way doesn't work in old browsers.
So you can use my function to do the work:
----------------
protected static String HTMLValueText (String s) {
String vs="VALUE=\"";
int i=s.indexOf(vs);
int j=i+vs.length();
vs="";
if (i>=0 && j<s.length()) {
i=j;
j=s.indexOf('\"', j);
if (j>=0 && j>i) {
vs=s.substring(i,j);
}
}
return vs;
}
public static String HtmlConvertToHidden(String s) {
if (s.startsWith("<INPUT TYPE=HIDDEN") ) {
return s;
}
if (s.startsWith("<INPUT TYPE=TEXT") ) {
s= CSpUtil.replaceSubstring(s, "<INPUT TYPE=TEXT", "<INPUT
TYPE=HIDDEN");
s += HTMLValueText(s);
return s;
}
if (s.startsWith("<INPUT TYPE=CHECKBOX") ) {
s= CSpUtil.replaceSubstring(s, "<INPUT TYPE=CHECKBOX", "<INPUT
TYPE=HIDDEN");
s += HTMLValueText(s);
return s;
}
if (s.startsWith("<SELECT NAME=")) {
s=CSpUtil.replaceSubstring(s, "<SELECT NAME=", "<INPUT
TYPE=HIDDEN NAME=");
boolean f=true;
String sels=" SELECTED>";
int i=s.indexOf(sels);
int j=s.indexOf('"', s.indexOf('"')+1);
int k=i+sels.length();
int l=s.length();
if (i>=0 && j>=0) {
if (k<s.length()) {
l=s.indexOf('<', k);
if (l<=0) l=s.length();
else s=s.substring(0, l);
}
i=s.lastIndexOf("<OPTION VALUE=");
if (i>=0 && j>=0) {
s=s.substring(0, j+1)+s.substring(i,
s.length());
s=CSpUtil.replaceSubstringAll(s, "<OPTION
VALUE=", " VALUE=");
s=CSpUtil.replaceSubstringAll(s, sels, ">");
f=false;
}
}
if (f) {
s=s.substring(0, j+1)+" VALUE=\"\">";
}
return s;
}
if (s.startsWith("<TEXTAREA")) {
s=CSpUtil.replaceSubstring(s, "<TEXTAREA", "<INPUT TYPE=HIDDEN
");
s=CSpUtil.replaceSubstring(s, ">", " VALUE=\"");
s=CSpUtil.replaceSubstring(s, "</TEXTAREA>", "\">");
s += HTMLValueText(s);
return s;
}
if (s.startsWith("<A ")) {
int i=s.indexOf('>');
if (i>=0) {
s=s.substring (i+1, s.length());
i=s.indexOf('<');
if (i>=0) s=s.substring (0, i);
}
else s="";
}
return s;
}
public static void HTMLConvertToHidden (CSpDisplayField vob)
{
vob.setHtmlText(AzUt.HtmlConvertToHidden(vob.getHtmlText()));
}
--------------------
"prasad" <[EMAIL PROTECTED]> wrote:
>
>Hi
>
> I am trying to make a textarea content is non-editable when the previous textfield
>content is a certain type.
>For example, the textfield content type is "PLAN", the next filed ie textarea is a
>non-editable.
>Could you please give me some suggestions and code for this problem.
>Thanks in advance.
>srinivas
_________________________________________________________________________
To unsubscribe from this mailing list please send an email to:
[EMAIL PROTECTED]
Please remember to use the same email address you subscribed with.
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]