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

My script don't run in web browser

pacopyp
Registered: Aug 28 2009
Posts: 6

hi

I have a pdf form that have a button, a inputText and two check box, when i push the button fires a javascript to validate if one of the check box is on then the input text dont have to be empty, is a very simple example.

When i open my form with Adobe 9 it works fine the javascript makes the validation but when i open my form in a web browser it dont works.

this is the script that i use, it is inside of my form and de action of my button calls it

"function validate() {"
+ "var married = this.getField('married');"
+ "var partner = this.getField('partner');"
+ "if (married.value == 'yes' && partner.value == '') {"
+ "app.alert('please enter the name of your partner');"
+" }");
I hope you can help me.

Regards

My Product Information:
Acrobat Pro Extended 9.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Is the value of the 'married' check box 'yes' or 'Yes'?

It appears you do not have matching braces for the function definition. The line "});" appears to terminate your 'if' statement and 'function' definition. Also a function definition does not end with a semi-colon.

function validate() {var married = this.getField('married');var partner = this.getField('partner');if (married.value.toLowerCase() == 'yes' && partner.value == '') {app.alert('please enter the name of your partner');} // end if (married.value == 'yes' && partner.value == '') return;} // end of validate function

George Kaiser

pacopyp
Registered: Aug 28 2009
Posts: 6
Thanks for your reply

but i still dont get it works,

the javascript works fine if i open my file in a local form, but when i try to open my form from a web browser the javascript dont work

where can i send you my form if you need to see it?

Regards
darkangel
Registered: Jan 24 2011
Posts: 1
Hi,
When i open a web page of a site i want on the bottom of the page there is a message of "enable the Javascript, refresh the page".
I check a lot of times and the script is enable but still i have the same problem.
Can anyone help me on this???

Gr