Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Should this be a function?

Avatar

Avatar
Level 1
Sean_hepburn
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Sean_hepburn
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
Sean_hepburn
Level 1

20-09-2009

Hi all, I have the code below attached to about 3000 small boxes that insert a text when clicked, it works very well, but I can't help thinking that it's not very efficient!

I've tried fragments, but each box needs to be referenced and I assume that if you change one fragment you change them all.

I also looked at functions and script objects, but I'm lost as it seems to me that you can't use (if - then) etc. within a function.

Would someone be kind enough to tell me if it's possible to convert this to a function and roughly how, please.

Many thanks..Sean

var deleted = substr(Header.currnturl[0].rawValue,64,150)

if (Header.currnturl[0].rawValue == null and $.rawValue == null) then

xfa.host.messageBox("Please paste a valid URL link into the first page", "No URL Link?", 0, 0)

elseif

($.rawValue == null) then

$.rawValue = deleted

$.access = "readOnly"

Rectangle10.assist.toolTip = deleted

else

var urljoin = concat((Header.urlstart[0].rawValue),

($.rawValue))

xfa.host.gotoURL(urljoin)

endif

Replies

Avatar

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

198 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

198 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
Steve_L_Walker
Level 9

20-09-2009

Hi Sean,

Could you please re-post this question to the LiveCycle Designer ES forum?

Having said that, take a look at the following

http://blogs.adobe.com/formfeed/2009/09/script_objects_deep_dive.html

Steve

Avatar

Avatar
Level 1
Sean_hepburn
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Sean_hepburn
Level 1

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
Sean_hepburn
Level 1

21-09-2009

Thank you Steve, I will read through that and I'll repost thsi as you say.

Sean