cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript in button event

Former Member
0 Kudos

Hi guys.. i getting crazy of the javascripting in button event.

Basically there is 2 button in my form and 1 textfield with initial value "SUBMIT". 2 button is with default caption "Button".

When user open the form, A button need to change the caption to "SUBMIT" and B button invisible. The user will change the textfield to "VERIFY" and save the form. When open the form again, the A button caption change to "VERIFY" and visible the B button and change caption to "REJECT".

I have add the javascript as below : -

if (data.textfield1.rawValue == "SUBMIT")

{

data.button1.caption.value.text.value = "SUBMIT";

data.button2.presence = "invisible";

}else if (data.textfield1.rawValue == "VERIFY"){

data.button1.caption.value.text.value = "VERIFY";

data.button2.caption.value.text.value = "REJECT";

data.button2.presence = "visible";

}

For the 1st time, button1 change caption to SUBMIT and button2 invisible. But the 2nd open, the button remain the same even i have put a messagebox in 2nd condition, it do calling the messagebox but the caption and presence is not working.

Anyone can advise?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The problem solved by change the PDf to dynamic.

fp_docparams-DYNAMIC = 'X'.

OttoGold
Active Contributor
0 Kudos

From my point of view the value never changes. I don´t understand the little mismatch where you test the textfield but changes the caption, not the value, but probably you have a reason to do that. I have never seen this and never used it this way. If I am right, you´re assigning and testing different values. That is probably the reason why it works for you only with the initial value.

If you didn´t read the basics, start here:

http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

Hope that helps a little, regards Otto

former_member214651
Active Contributor
0 Kudos

Hi,

In which event of the Interactive form have u written this code? if u have written in the Init block, it gets executed only once.

try writing the same code in the docReady event which executes everytime the form is loaded.

Another suggestion. try using FormCalc instead of Javascript in Interactive forms. The coding what u have done remains the same

Regards,

Poojith MV