cancel
Showing results for 
Search instead for 
Did you mean: 

Enable the input field when user clicks on check box

former_member221372
Participant
0 Kudos

Hi All,

I am new to Adobe Forms and need help from you guys.

Gone through sdn links but couldn't find the required solution.

We are sending a PDF Form to bussiness via mail.

1. User opens the pdf & when they clicks on check box then input field should be editable.

2.If they clicks on submit without entering the input field, then it should through Error message.

How to achieve these 2 issues.

Kindly suggest.

Regards,

Bharat

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

1. You can achieve this by writing the java script code at on change event of checkbox as below

//For making it disable .

if(condition){

TextField1.access = "readOnly" ;

TexField1.fillColor = "224,224,224"; //Gray color

}

else{

//for making it editable

TextField1.access = "open" ;


TexField1.fillColor = "255,255,255" ; //white color

}

former_member221372
Participant
0 Kudos

Hi Jitendra,

I already tried this but in intialization & enter event of input filed, but didn't work.

this.access = "open";

Regards,

Bharat

former_member221372
Participant
0 Kudos

Hi Jitendra,

Thanks...it's working.I did a mistake.Didn't fill FILLABALE = 'X'.

This is working for single input field, how to write for a table & How to populate ERROR message.

Regards,

Bharat

0 Kudos

Hi Bharath,

to access any particular field or element first check the hierarchy (check the attach image)

ex: if i want to make Cell2 non editable, then code will be Node.Main.sfTab1.Table1.Row1.Cell2.access = "readOnly" ;

(case sensitive)

so to make table uneditable:

Node.Main.sfTab1.Table1.access = "readOnly" ;


2. Display Error message

at button click event, add code for pop-up message


if(TextField1.rawValue == null) {

var oDlg =

{

  description:

  {

  name: "dialog1",

  elements:

  [

  {

        type: "static_text",

        name: "Your Error Message",

   },

  {

  type: "ok_cancel",

  },

  ]

  }

};

app.execDialog(oDlg);

}

regards,

Jyoti