These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Remove red colour border

patra
Registered: Oct 19 2006
Posts: 270

Hi everyone!
I have write a script for a checkbox for required fields.
here is my script:

var c =this.getField("cb1");
if(c.isBoxChecked(0))
{
app."Fields with red border are required!",3);
var f = this.getField("Text1");
var b = this.getField("Text2");
f.required = true;
f.strokeColor=color.red;
b.required = true;
b.strokeColor=color.red;
}
else
{
f.strokeColor=color.transparent;
b.strokeColor=color.transparent;

}
It is working fine but I have a problem!
After when I insert the data into required filds how can I remove the red stroke border?
Again thanks for your help!!!

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You have to add JavaScript to each text field to remove the highlighting when the user leaves each field if there is data present and set the highlighting if the field is empty.. You should also change your script for the check box to test the text fields for data and not highlight the field if data is present, if this is your logic.

George Kaiser

patra
Registered: Oct 19 2006
Posts: 270
Thanks a million for your reply!
I am trying to figure out how...... but not luck...
I will appreciate very much if you can help me a little bit with the script....

Thanks my friend