/    Sign up×
Community /Pin to ProfileBookmark

is javascript the same for html as it would be for adobe?

I’m creating forms in adobe and customizing certain criteria using javascript. It’s all the same, right?

I’m assuming that not enough people will have acrobat pro to test with, but I’ll attach the file regardless. I don’t know where else to go and have been searching for several days with no success.

My trouble is:

I have a field named REFUND.
I have two radio buttons named METHOD; one export value (paid) is NO and the other (PoA) is YES.
I have another field named FEE.

What’s meant to happen is depending on which METHOD is chosen, FEE calculates a 20% or 30% fee from REFUND. If paid is chosen, FEE calculates REFUND * .2. If PoA is chosen, FEE calulates REFUND * .3.

This s the code I hacked my way through for adobe to finally accept, but it doesn’t work. Am I missing something?

[code]
var f = this.getField(“METHOD”);
var r = this.getField(“REFUND”);
{
if (f = “NO”) {
event.value = Math.abs(r.value * .2)
}
Else ;{
event.value = Math.abs(r.value * .3)
}
}
[/code]

I’m not expecting nothing from anyone, but I’m truely hoping. If my trouble is inappropriate for this site or forum, please let me know and I’ll go elsewhere.

Thanks for your attention,

Jim

[upl-file uuid=d9341e35-cabe-469b-9926-124c2360d7dd size=35kB]Untitled2.pdf[/upl-file]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@ZeroKilledOct 31.2007 — i hadn't read your post entirely, but the answer to your question (title) is yes and no. yes, because you use exactly the same syntax and core object as in any javascript implementation. but differ in the client-side implementation. for example, you can use object as Date, Array, Number, Object, Boolean and so on (which are core object). but you can't use object like navigation, document, window, links, and so on (which are client-side object) because those object are specific for browser implementation.

you should look for an acrobat pro javascript reference on how to traverse document object and which are their properties, so you can do your stuff. this don't only apply for acrobat pro, also to photoshop and any other javascript implementation. of course, i mean standard javascript based on the ecmascript.
Copy linkTweet thisAlerts:
@daamyourauthorOct 31.2007 — i hadn't read your post entirely, but the answer to your question (title) is yes and no. yes, because you use exactly the same syntax and core object as in any javascript implementation. but differ in the client-side implementation. for example, you can use object as Date, Array, Number, Object, Boolean and so on (which are core object). but you can't use object like navigation, document, window, links, and so on (which are client-side object) because those object are specific for browser implementation.

you should look for an acrobat pro javascript reference on how to traverse document object and which are their properties, so you can do your stuff. this don't only apply for acrobat pro, also to photoshop and any other javascript implementation. of course, i mean standard javascript based on the ecmascript.[/QUOTE]


Thanks ZeroKilled. I'm still searching the internet for adobe specific javascript help, but still hoping maybe someone here might have additional suggestions.
Copy linkTweet thisAlerts:
@daamyourauthorOct 31.2007 — I did find the adobe forums and have posted on them for help in this. For a company as big as they are, the forum is very... um... amature.
×

Success!

Help @daamyour spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...