Getting a Button to add a picture further down the form

E

Edward VN

Please would someone be kind enough to tell me how i can get a Button (when
clicked) to add a picture (user will browse for it) further down the form
Many thanks
Edward
 
K

K.Ramana Reddy(GGK Tech)

Hi,

You can do one thing.
when you clcik on button, set the some value for some field in dataSource
and based on that set conditional formatting(hide/show) for picture control.

Another way is: You can use check box to set conditional formatting on
picture control(when it is checked you need show the picture control
otherwise hide)

I hope this will help for you.
 
E

Edward VN

I am sorry to be a nuisance but i am a beginer to infopath, could you be a
little more specific.

Kind Regards and thank you for your very prompt help.

Edward
 
K

Kalyan G Reddy MVP (GGK Tech)

Hello

Set to add value to a field(dummy) in datasource when the button is clicked
Basing on this value and using conditional formatting you can Hide/show the
Picture control in the below of the form. so when the button is clicked , the
value is set into this field and the conditional formatting is fired. the
hidden pictural control will be shown. now you can browse and insert a
picture.

If the button is not clicked, value is not set and the Picture control will
be hidden.

I hope it is clear now.
 
K

K.Ramana Reddy(GGK Tech)

Hi,

kalyan explained about button Button click, there is a another way to do this.

Place some check box into form,
see properties of check box will have by default value when cleared ="false"
and value when checked "true", you can either way.
Based on checked and unchecked you can set the conditional formatting on the
picture control.
 
E

Edward VN

Thank you, how do i set the button to add a value to a field(dummy) in
datasource when the button is clicked?,
 
E

Edward VN

Ok, i now understand it, i have set the check box to apply a rule based on
the value but what is the 'function' called that will allow me to browse for
and insert a picture.

Kind Regards

Edward
 
K

K.Ramana Reddy(GGK Tech)

Hi,


Add the Dummy field in dataSource and assign the some value to t he field,
based on this you can set the conditional formatting on the picture control.

This is VB script code.
------------------------------------------
Sub CTRL6_5_OnClick(eventObj)
' Write your code here
dim x

X = XDocument.DOM.selectSingleNode("/my:myFields/my:Dummy").text="somevalue"
End Sub

This is Javascirpt code
----------------------------------------------
function CTRL1_5::OnClick(eventObj)
{
var X

X = XDocument.DOM.selectSingleNode("/my:myFields/my:Dummy").text="somevalue";

}

I hope this will help for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top