on 12-17-2008 10:38 AM
Hi,
I have a table in Online Adobe form, and one of the field in the table is Check Box, if the check box is selected the next field(with in the same table) should be left blank else it should issue some error like leave blank.
Can some one tell me how to to do this using javascript?
Ravi
Ravi,
For eg:- Lets assume you have a table name Table1 with 2 rows (Row1 and Row2) & 3 columns.
Row 1 has three cells --> Cell1 (which contains check box), Cell2(InputField which needs to be kep blank), Cell3( Assume its a numeric field)
Similarly Row 2 has three cells --> Cell1 (which contains check box), Cell2(InputField which needs to be kep blank), Cell3( Assume its a numeric field)
So the hierarchy will be
Table1
|--- Row1
|-----CheckBox1
|-----Cell2
|-----Cell3
|--- Row2
|-----CheckBox2
|-----Cell2
|-----Cell3
Now write following code in JavaScript in the change event of CheckBox1.
var currVal = Table1.Row1.CheckBox1.rawValue;
//xfa.host.messageBox("Current Val is : "+currVal);
if(currVal == 1) // Means checkbox is selected
{
xfa.host.messageBox("Please Leave Next Field blank");
Table1.Row1.Cell2.access = "readOnly";
}
else
{
Table1.Row1.Cell2.access = "open";
}
Similarly, you need to write code for CheckBox2 of Row2.
Chintan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.