Expand my Community achievements bar.

SOLVED

Difference between Click and Change event

Avatar

Level 5

Not sure what would be causing this, so any input would be very helpful

I am using the following JAVA script to set focus on a text box after the user clicks on in a check box.

Using the “Click” event

xfa.host.setFocus(form1.requester_info.m_approve.Table9.Row1.m_name);

When I click on the check box, nothing happens. Focus does not move

Using the “Change” event I use the same code;

xfa.host.setFocus(form1.requester_info.m_approve.Table9.Row1.m_name); It works.

I have 4 check boxes on the form that will use this code(changing the focus of course) and I get the same results for each check box.

Anyone have any ideas what I could be doing to bugger this up

Chomp

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Just tried it here and it is working fine on both events. I used version 9 and 8 of Acrobat. If it is working for you then that is great ...if you want to pursue this further then read on.....

What version ore you using?

When you move the code to the click event you can add an app.alert("Click event fired!") to indicate that the event fired (just as a message to yourself for debugging purposes. If it still does not work check the javascript console by hitting Cntrl - J (assuming you are using Acrobat) and see if there are any error messages, In this case the change and the click event are doing the same thing.

Paul

View solution in original post

5 Replies

Avatar

Level 10

So what's the problem with using the Change event?

To answer your question though, I believe the main difference for a check box is that you are changing the value when you click on it, hence the Change event. I could be wrong though.

Avatar

Former Community Member

Just tried it here and I am getting the same behaviour ....can you send me your form so I can test it?

LiveCycle8@gmail.com

Paul

Avatar

Level 5

Hello pguerett

I am sorry for leaving this until today but……weekend… I thought I would like to be form free for a couple of days.

I have uploaded the form to https://acrobat.com/#d=fNcy51Gm0hBYRTEwS4SMww

For you to review. I have set the form up as people would see it if when they first open the form. The user will need to click on text boxes to open up different parts of the form. I am a believer in the phrase, “if you don’t need to read it, you don’t need to see it”. Please keep in mind I have not added all the help notes nor have I completed the accessibility text.

You will see that I have used the “change” and not the “click” as I was still unable to get the “click to work.

Thanks Again

Avatar

Correct answer by
Former Community Member

Just tried it here and it is working fine on both events. I used version 9 and 8 of Acrobat. If it is working for you then that is great ...if you want to pursue this further then read on.....

What version ore you using?

When you move the code to the click event you can add an app.alert("Click event fired!") to indicate that the event fired (just as a message to yourself for debugging purposes. If it still does not work check the javascript console by hitting Cntrl - J (assuming you are using Acrobat) and see if there are any error messages, In this case the change and the click event are doing the same thing.

Paul

Avatar

Level 5

Thanks pguerett

I tried it here.... It now seems to be working fine. As a note. I brought it up in Reader 9 and the "click" function worked fine. When I brought it up in Adobe Acrobat Professional 8, it did not work.......

Thanks Again pguerett

Chomp

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----