JavaScript checkbox
Linoa
-
Ozimandias Posted messages 528 Status Member -
Ozimandias Posted messages 528 Status Member -
Hello,
I created a form in Adobe and I have a checkbox called "precours" that should take the value from another field called "cours" if it is checked. Then this value is taken into another field called "hebdo". How can I make it so that when you click the checkbox once, the value appears directly in the "hebdo" field?
Thank you in advance for your support!
I created a form in Adobe and I have a checkbox called "precours" that should take the value from another field called "cours" if it is checked. Then this value is taken into another field called "hebdo". How can I make it so that when you click the checkbox once, the value appears directly in the "hebdo" field?
Thank you in advance for your support!
Configuration: Mac OS X Safari 531.21.10
7 answers
-
Which Adobe software?
Flash, Fireworks, Acrobat Pro? The language is not the same in all these software.
--
Two intellectuals sitting go less far than a brute walking.
!!! You got an answer... Remember to mark your topics as resolved!!! -
-
Whoa, I'm pulling out my books... and I'll tell you this.
--
Two sitting intellectuals go less far than a brute who walks.
!!! You have received an answer... Remember to mark your topics as resolved!!! -
You need to:
display the properties of your checkbox (the starting one) with right click properties.
after giving it a unique identifier (name) you need to go to the action tab and add code there
Here is basically what you will need in this code:
how to find a fieldthis.getField("FieldName")
so to get the associated value of the fieldthis.getField("FieldName").value
As for if statements and other conditional structures, they work like JavaScript.
Your code should look like this:
if (this.getField("course").value == "checked"){ this.getField("precourse").value = "checked"; this.getField("weekly").value = "checked"; }
All the explanations of this language in PDF format here http://www.google.fr/...
--
Two intellectuals sitting go less far than a brute walking.
!!! You have received a response ... Remember to mark your topics as resolved !!! -
ben du coup:
if (this.getField("cours").value == "checked"){ this.getField("precours").value = "checked"; this.getField("hebdo").value = "checked"; } else this.getField("precours").value = ""; this.getField("hebdo").value = ""; }
si ça ne marche pas essaye avec this.getField("precours").value = false;
--
Deux intellectuels assis vont moins loin qu'une brute qui marche.
!!! Vous avez obtenu une réponse ... Pensez à marquer vos sujets comme résolus !!! -
after else there's a { that I forgot.
--
Two intellectuals sitting go less far than a brute who walks.
!!! You have received an answer... Remember to mark your topics as resolved !!!-
Hello,
Thank you so much for this working script! However, my form (Adobe ACROBAT) is finished, but when I send it to someone for filling, there’s an error message like "no access to this method due to security concerns." There’s no protection on the document, so I’m puzzled.
Thank you in advance for your support.
-
-
I believe this is beyond my skills, note the exact message is better. Because "something like that" is not very precise.
--
Two intellectuals sitting go less far than a brute who walks.
!!! You have received a response... Remember to mark your topics as resolved!!!