Expand my Community achievements bar.

SOLVED

Textbox mandatory with red boarder / Textbox invisible

Avatar

Level 4

My problem:

I have a textbox that gets invisible when a checkbox is checked in form 1 and invisible if unchecked.

I have a textbox that gets mandatory with a red boarder when a checkbox is checked in form 2; if unchecked the boarder is gone and the field is optional.

Now I want to achieve both.

Since the forms are 2 different versions, none of the other scripts works out. Whatever I tried, it didn't work... (Copied the fields into the other form... so the script is 100% the same.)

Any suggestions how I could either change my scripts, the settings or tiptoe around the problem so I can use the both of them in one form?

My two scripts:

if (this.rawValue == "J") {
Textfield.validate.nullTest = "error";
Textfield.border.edge.color.value = "255,0,0";
Textfield.assist.toolTip.value = "This field is mandatory, please provide a response...";
xfa.layout.relayout();
}
else {
Textfield.validate.nullTest = "disabled";
Textfield.border.edge.color.value = "255,255,255";
Textfield.assist.toolTip.value = "This field is optional...";
xfa.layout.relayout();
}

if (this.rawValue == "J")
{
Textfield.presence = "visible";
}
else
{
Textfield.presence = "invisible";
}

1 Accepted Solution

Avatar

Correct answer by
Level 6

Sorry, made mistake. You have to set your fields hidden instead invisble. In this case subform will became smaller size.

Mail sent.

View solution in original post

15 Replies

Avatar

Level 6

Hi,

Main problem in if condition, for checkbox you have to use if (this.rawValue == 1) instead of this.rawValue == "J".

I made example form, you can check it.

BR,

Paul Butenko

Avatar

Level 4

Didn't work...

Both scripts ARE working. But they work in different forms.

Hope your PDF is soon dequeued though...

Another side question. Since I have not much experience with  floating fields...

I want to make a subform by clicking a checkbox invisible/visible... since it takes quite some place is there a possibility to make the following fields go up if it dissapppears?

(I'm quite out of it right now, sry...)

Avatar

Level 6

Hi,

Give me email and I'll send you form.

Regarding subform. Yes you can make next fields going up.  For this you subform, where this fields placed, should be Flowed Top to Bottom.

1.JPG

BR

Avatar

Level 4

hmm tried that... though all I managed was to get the subforms lower when Textfields expanded... not when they got invisible...

Wellwell ^^ I look forward to your mail.

My e-mail adress:

tryout@web.de

Avatar

Correct answer by
Level 6

Sorry, made mistake. You have to set your fields hidden instead invisble. In this case subform will became smaller size.

Mail sent.

Avatar

Level 4

Next Issue... your form works quite good. But I get a Javascript warning that I need to download a newer version of Adobe Reader.

With my other two versions I don't get this one and I would prefer not to get it (especially since the ones who receive it will complain)

This drives me mad, slow but surly.

Avatar

Level 6

This is because I made form for versionof Adobe Reader 9 or higher. You can change version in File - Form properties - Defaults.

1.JPG

BR

Avatar

Level 4

Slowly driven crazy...

It's the third form I have that behaves completly different with exactly the same script.

Thank you VERY MUCH ^^

One last question (and probably dump):

I have copied several Textfields into your form. The original ones had been underlined.

In your form there are only blue boxes displayed and the underline only appears when you enter the box.

Is there any possibility to underline the Textboxes in your form?

Neither underline nor setting the lower boarder did work.

Avatar

Level 4

I know that this kind of layout problem is most likly not really hard to solve, I just never was confronted to it.

I don't get why the three forms of mine behave sooooo differently.

Avatar

Level 6

Maybe because of different version of it, or designer ES where they were developed )

Avatar

Level 4

Yeah most likly...

(That was also why I needed the boarder. In my old version making a field dynamically made mandatory didn't have a red boarder....)

You have no problems with underlined textfields?

Avatar

Level 4

Hmm...

Lifecycle Version 8.2.1.3158.....

PDF Version 1.7

ARG it gets worse...

Could you send me another testform, just with an underlined Textfield?

I wanna check out the xml, probably I can find some difference there.

(Yeah I am a vile XML scamp)

Thanx already

Avatar

Level 4

Could you resend it?

Waited till right after you posted but it's still not here...

Like before: tryout@web.de