Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Hide a Button based on dropdown selection

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Hide a Button based on dropdown selection
mbachu[ at ]gmail.com 22.09.2006 13:35:22
Hi,
I am new to InfoPath and I developed a survey page which has some
Radio buttons, dropdown list, text boxes, Save&Close and Submit button.

When I open the form for the first time, I would like to display only
the SUBMIT button which will submit the survey with a predefined file
name(Project name -dropdown box).

When they open an existing form, I would like to hide the SUBMIT button
and display only the SAVE&CLOSE button. (Since it is displaying both
Submit and Save&Close buttons now, user is selecting one of the buttons
and it is causing the problem)

I have a drop down list which has the project name. If the user opens
the form for the firsttime, it displays Select... and the user can
select the project name and submit the form and it saves with the
project name.

When they open exisitng form it displays the project name in the
dropdown list.

How can hide one of the buttons (Save&Close & Submit) based on this
drop down selection?

RE: Hide a Button based on dropdown selection
S.Y.M. Wong-A-Ton 25.09.2006 06:01:02
What you basically want to to is recognize whether the form has been saved
once before or whether it is new, and based on this fact show/hide buttons.
Look into using the IsNew property (see
http://msdn.microsoft.com/library/en-us/ipsdk/html/xdproIsNew_HV01021289.asp?frame=true).
You can add a helper field to your Main data source (but not to any view,
since you won't be showing its value) and set the value of this field in the
OnLoad event of the form based on whether the form is new or not by using
IsNew. Then you can set conditional formatting on the buttons to show/hide
them based on the value of this field.
---
S.Y.M. Wong-A-Ton


"mbachu[ at ]gmail.com" wrote:

[Quoted Text]
> Hi,
> I am new to InfoPath and I developed a survey page which has some
> Radio buttons, dropdown list, text boxes, Save&Close and Submit button.
>
> When I open the form for the first time, I would like to display only
> the SUBMIT button which will submit the survey with a predefined file
> name(Project name -dropdown box).
>
> When they open an existing form, I would like to hide the SUBMIT button
> and display only the SAVE&CLOSE button. (Since it is displaying both
> Submit and Save&Close buttons now, user is selecting one of the buttons
> and it is causing the problem)
>
> I have a drop down list which has the project name. If the user opens
> the form for the firsttime, it displays Select... and the user can
> select the project name and submit the form and it saves with the
> project name.
>
> When they open exisitng form it displays the project name in the
> dropdown list.
>
> How can hide one of the buttons (Save&Close & Submit) based on this
> drop down selection?
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net