Highlighted

visible hidden subform

Avatar

Avatar

SnookerDJ

Avatar

SnookerDJ

SnookerDJ

01-04-2009

Hi



I can get subforms to hide or be invisible using the change event and presence function. However, what I want to be able to do is click on a button which validates my form and then only displays the subform once validation is accepted (i.e. ivar = 0 but not if ivar = 1) I have tried lots of things but cant get anything to work on this. Does anyone have any suggestions?



Thanks

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

01-04-2009

In javascript a comparison is == not = so your script will look something like this:



if (ivar == 0){

hide subform

} else {

show subform

}



You would put this code on the click event of the button.
Highlighted

Avatar

Avatar

SnookerDJ

Avatar

SnookerDJ

SnookerDJ

01-04-2009

Hi Paul



This is the code i have used:

if (iVar==0){

Page.Subform.presence ="visible"}

else {

Page.Subform.presence ="hidden"

}

This works fine if it is the only click event, however if there is a code prior to this where you have two conditions (0,1) then it does not seem to work. I know the code before it is correct as immeditaely before thisan if (iVar == 0) statement works correctly so I am not sure what the problem is.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

01-04-2009

Send me the form so I can see it .....livecycle8@gmail.com
Highlighted

Avatar

Avatar

SnookerDJ

Avatar

SnookerDJ

SnookerDJ

03-04-2009

Hi Paul



I had a play around with the form to send you an abbriveated example and I sort of got it to work (one page document and subform set to hidden). On button click it would then display the hidden subform. When I applied the code again to the whole form it did not work so I have been trying to get it working again for my own learning.



Eventually, in the full form with multiple pages I changed the subform so that it is initially invisible and hey presto it now works.



Is there any explanation for that? When looking at documents on web it did not really indicate that this shoudl matter.



Thanks



Darren