Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Javascript popup
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Javascript popup

 Post Reply Post Reply Page  12>
Author
Maureen View Drop Down
New Member
New Member


Joined: 09 Jun 2015
Location: Netherlands
Points: 24
Post Options Post Options   Quote Maureen Quote  Post ReplyReply Direct Link To This Post Topic: Javascript popup
    Posted: 09 Jun 2015 at 12:01pm
Hello,

I'm new with creating fillable pdf forms. Can I get help with a javascript?

I have a field called "kids". The user can fill in number of kids he/she has. When a value is entered in this field, a popup must appears with the text "please fill in the birthday of the children"

thanks in advanced
Maureen
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jun 2015 at 1:08pm
Use this code as the field's custom validation script:
if (event.value) app.alert("Please fill in the birthday of the children.",3);
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
Maureen View Drop Down
New Member
New Member


Joined: 09 Jun 2015
Location: Netherlands
Points: 24
Post Options Post Options   Quote Maureen Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jun 2015 at 2:01pm
Thanks for the help. But I just notice that there already is a validation on the field. In the kids field the user can only enter a value between 0-4 kids. Is there another place where I can enter the script you've sended?
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jun 2015 at 8:41pm
Yes, as the On Blur event. Just change "event.value" to "event.target.value"
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
Maureen View Drop Down
New Member
New Member


Joined: 09 Jun 2015
Location: Netherlands
Points: 24
Post Options Post Options   Quote Maureen Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jun 2015 at 1:00pm
I'm sorry but I'm a really "rookie" with Java stuff. What is the Onblur event? Were do I place the script?
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2015 at 5:48pm
Under the field's Properties, Actions tab.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
Maureen View Drop Down
New Member
New Member


Joined: 09 Jun 2015
Location: Netherlands
Points: 24
Post Options Post Options   Quote Maureen Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jul 2015 at 6:13pm
The code is working, I've placed it on the Calculation tab > custom calculation field of the field where I wanted the popup. But when I enter a value in any other field in the form, the popup appears. What did I do wrong?
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jul 2015 at 6:27pm
You didn't follow the instructions I've provided above. This is not a calculation script.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
Maureen View Drop Down
New Member
New Member


Joined: 09 Jun 2015
Location: Netherlands
Points: 24
Post Options Post Options   Quote Maureen Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jul 2015 at 8:07pm
I'm sorry. I did it now, but I don't know what trigger to use. I want that the popup appears at the moment the user has filled in a value and click in another field
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jul 2015 at 8:39pm
I told you already, use the On Blur event.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
Maureen View Drop Down
New Member
New Member


Joined: 09 Jun 2015
Location: Netherlands
Points: 24
Post Options Post Options   Quote Maureen Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jul 2015 at 6:47pm
Oeps Sorry. This also works. Thank you

Can I ask 1 more thing. Hope this is the last one

For example: Field1=100, Field2= 300, In field3 I have a calulation Field1-Field2. I need a script in Field3 that change the text. If Field1>field2 the text color change in blue and if Field1<Field2 the color must be red.

Hope you can help again



Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.063 seconds.