make a column in tab form readonly but writable when you press Add the line

Hi all

I have several pages with tabular forms based on a single table with an ID as the key primary and filled with a sequence by a trigger. So far so good. Now, I also have the 'significant primary key', presents a second column that has a unique key constraint. Now, I want to make this column readonly tabular form for all records already there and I want to do is return to writing when I push add line. So in fact, a user can insert this 'unique key', but then he can't change it more.

I already tried to use java script as
< script type = "text/javascript" >
$(document) .ready (function () {}

var arr1 = $("td[@headers=ART_ID]");
for (i = 0; i < arr1.length; i ++)
{
If ($(arr1_).html() == null | $(arr1[i]).html () .length == 0)
{
{$(arr1[i]).each (function ()}
$(arr1[i]).readOnly = true ;}) ;
}
on the other
{
{$(arr1[i]).each (function ()}
$(arr1[i]).readOnly = false ;}) ;
}
}
});
< /script >

But this only works with the "disabled" attribute, but then I had the problem that I can't introduce any line.

Anyone with a solution for this?

Thank you

Erwin

O.K.

so you use javascript to loop on columns and set the attributes of cells to all that. You're right, disabled will cause the error message "no data found" to appear (I've had this a few days ago and first I wondered why :)).

Of course, readonly works. You just need to write a little different:

$x('f01_0001').readOnly = "readonly";

and it will do the job.

See this example:

http://Apex.Oracle.com/pls/OTN/f?p=31517:213

Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
-------------------------------------------------------------------

Tags: Database

Similar Questions

Maybe you are looking for